Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Push
Push with colliders working.
  • Loading branch information
aps16104 committed Feb 18, 2020
1 parent 2f63e73 commit 77b71d9
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 22 deletions.
4 changes: 2 additions & 2 deletions SpaceShooter/Assets/Prefabs/Bolt.prefab
Expand Up @@ -42,9 +42,9 @@ Rigidbody2D:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2786470009650213004} m_GameObject: {fileID: 2786470009650213004}
m_BodyType: 0 m_BodyType: 1
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 1
m_UseAutoMass: 0 m_UseAutoMass: 0
m_Mass: 1 m_Mass: 1
m_LinearDrag: 0 m_LinearDrag: 0
Expand Down
128 changes: 116 additions & 12 deletions SpaceShooter/Assets/Scenes/Main.unity
Expand Up @@ -130,7 +130,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!70 &128653740 --- !u!70 &128653740
CapsuleCollider2D: CapsuleCollider2D:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
Expand All @@ -144,7 +144,7 @@ CapsuleCollider2D:
m_IsTrigger: 0 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: 0.0071042776, y: -0.00710422} m_Offset: {x: 0, y: 0}
m_Size: {x: 1.0967723, y: 0.7699729} m_Size: {x: 1.0967723, y: 0.7699729}
m_Direction: 1 m_Direction: 1
--- !u!50 &128653741 --- !u!50 &128653741
Expand Down Expand Up @@ -180,6 +180,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1024978147} - {fileID: 1024978147}
- {fileID: 283186217}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -195,12 +196,45 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f3ad58b78663c704da3af8c9543b3c18, type: 3} m_Script: {fileID: 11500000, guid: f3ad58b78663c704da3af8c9543b3c18, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
speed: 5 speed: 7.5
boundary: boundary:
xMin: -2.75 xMin: -4.25
xMax: 2.75 xMax: 4.25
yMin: -0.8 yMin: -0.5
yMax: 7 yMax: 10
shot: {fileID: 2786470009650213004, guid: 9e195a83d88cbaf4fa88db914f35bca4, type: 3}
shotSpawn: {fileID: 283186217}
fireRate: 0.15
--- !u!1 &283186216
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 283186217}
m_Layer: 0
m_Name: Shot Spawn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &283186217
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 283186216}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 128653742}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &534669902 --- !u!1 &534669902
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
Expand Down Expand Up @@ -253,7 +287,7 @@ Camera:
far clip plane: 1000 far clip plane: 1000
field of view: 60 field of view: 60
orthographic: 1 orthographic: 1
orthographic size: 5 orthographic size: 7.5
m_Depth: -1 m_Depth: -1
m_CullingMask: m_CullingMask:
serializedVersion: 2 serializedVersion: 2
Expand All @@ -277,8 +311,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 534669902} m_GameObject: {fileID: 534669902}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.71, z: -10} m_LocalPosition: {x: 0, y: 6.43, z: -10}
m_LocalScale: {x: 1, y: 1.12, z: 1} m_LocalScale: {x: 1, y: 3.67, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
Expand Down Expand Up @@ -433,9 +467,79 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1748514799} m_GameObject: {fileID: 1748514799}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 6.53, z: 0} m_LocalPosition: {x: 0.06, y: 7.89, z: 0}
m_LocalScale: {x: 8, y: 16, z: 1} m_LocalScale: {x: 13.808219, y: 19.957363, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1942229631
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1942229634}
- component: {fileID: 1942229633}
- component: {fileID: 1942229632}
m_Layer: 0
m_Name: Boundary
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1942229632
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942229631}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 12abe88a40cb467499d72908ee8467de, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!61 &1942229633
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942229631}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 1
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!4 &1942229634
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942229631}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.19, y: 7.8, z: 1}
m_LocalScale: {x: 15, y: 20.8, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
16 changes: 9 additions & 7 deletions SpaceShooter/Assets/Scripts/DestroyByBoundary.cs
Expand Up @@ -3,14 +3,16 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;


public class DestroyByBoundary : MonoBehaviour public class DestroyByBoundary : MonoBehaviour
{ {
//void OnTriggerExit2D(Collider2D other)
// {
// Destroy(other.gameObject);
//}


void OnTriggerExit(Collider other) void Update()
{ {
Destroy(other.gameObject);
} }

void OnTriggerExit2D (Collider2D other)
{
Destroy(other.gameObject);
}

} }
3 changes: 2 additions & 1 deletion SpaceShooter/ProjectSettings/TagManager.asset
Expand Up @@ -3,7 +3,8 @@
--- !u!78 &1 --- !u!78 &1
TagManager: TagManager:
serializedVersion: 2 serializedVersion: 2
tags: [] tags:
- Shot
layers: layers:
- Default - Default
- TransparentFX - TransparentFX
Expand Down

0 comments on commit 77b71d9

Please sign in to comment.