aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'nGJ2019')
-rw-r--r--nGJ2019/Assets/Prefabs/RockJaws.prefab238
-rw-r--r--nGJ2019/Assets/Prefabs/RockJaws.prefab.meta7
-rw-r--r--nGJ2019/Assets/Scripts/ObstacleSpawner.cs1
-rw-r--r--nGJ2019/Assets/Scripts/RockJaws.cs37
4 files changed, 283 insertions, 0 deletions
diff --git a/nGJ2019/Assets/Prefabs/RockJaws.prefab b/nGJ2019/Assets/Prefabs/RockJaws.prefab
new file mode 100644
index 0000000..7d97aed
--- /dev/null
+++ b/nGJ2019/Assets/Prefabs/RockJaws.prefab
@@ -0,0 +1,238 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1998900778231223134
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1998900778231223133}
+ - component: {fileID: 7713002535168256047}
+ m_Layer: 0
+ m_Name: RockJaws
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1998900778231223133
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1998900778231223134}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: -7.886415, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 6829481666799721321}
+ - {fileID: 6829481667242832773}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &7713002535168256047
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1998900778231223134}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: b69da2d4b545440ed86bcb8e72e0a7eb, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ TopJaw: {fileID: 6829481666799721321}
+ BottomJaw: {fileID: 6829481667242832773}
+ Speed: 10
+--- !u!65 &7350926945773242645
+BoxCollider:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7538015035249639830}
+ m_Material: {fileID: 0}
+ m_IsTrigger: 1
+ m_Enabled: 1
+ serializedVersion: 2
+ m_Size: {x: 9.5, y: 5.46, z: 1}
+ m_Center: {x: 1.06, y: -3.84, z: 0}
+--- !u!65 &2761854514729097118
+BoxCollider:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7538015035695901050}
+ m_Material: {fileID: 0}
+ m_IsTrigger: 1
+ m_Enabled: 1
+ serializedVersion: 2
+ m_Size: {x: 7, y: 4.32, z: 1}
+ m_Center: {x: 0, y: 0.96, z: 0}
+--- !u!1001 &1998900778239684723
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 1998900778231223133}
+ m_Modifications:
+ - target: {fileID: -927199367670048503, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_Name
+ value: obstacle_rock_top
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalPosition.x
+ value: 1.830543
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 4.74
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalRotation.y
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalRotation.z
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_RootOrder
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: 416fae093739c55499f7dcb7d4f7f2c9, type: 3}
+--- !u!1 &7538015035695901050 stripped
+GameObject:
+ m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ m_PrefabInstance: {fileID: 1998900778239684723}
+ m_PrefabAsset: {fileID: 0}
+--- !u!4 &6829481666799721321 stripped
+Transform:
+ m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9,
+ type: 3}
+ m_PrefabInstance: {fileID: 1998900778239684723}
+ m_PrefabAsset: {fileID: 0}
+--- !u!1001 &1998900778732132511
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 1998900778231223133}
+ m_Modifications:
+ - target: {fileID: -927199367670048503, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_Name
+ value: obstacle_rock_bottom_1
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalPosition.x
+ value: 1.1761003
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalPosition.y
+ value: -1.39
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalRotation.y
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalRotation.z
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_RootOrder
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: fbb1d264bae087340a30a49b9b9e0148, type: 3}
+--- !u!1 &7538015035249639830 stripped
+GameObject:
+ m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ m_PrefabInstance: {fileID: 1998900778732132511}
+ m_PrefabAsset: {fileID: 0}
+--- !u!4 &6829481667242832773 stripped
+Transform:
+ m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: fbb1d264bae087340a30a49b9b9e0148,
+ type: 3}
+ m_PrefabInstance: {fileID: 1998900778732132511}
+ m_PrefabAsset: {fileID: 0}
diff --git a/nGJ2019/Assets/Prefabs/RockJaws.prefab.meta b/nGJ2019/Assets/Prefabs/RockJaws.prefab.meta
new file mode 100644
index 0000000..5c1e1ac
--- /dev/null
+++ b/nGJ2019/Assets/Prefabs/RockJaws.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: a2b1bab6b90944171a71ff986bce4ebf
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
index a9d1078..c285352 100644
--- a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
+++ b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
@@ -47,6 +47,7 @@ public class ObstacleSpawner : MonoBehaviour
timeline.Add(2, 2.75f, ObstacleType.rockTop);
timeline.Add(8, -2, ObstacleType.rockBottom);
timeline.Add(20, 0, ObstacleType.narrowPassage);
+ timeline.Add(30, 0, ObstacleType.rockJaws);
timeline.OnSpawnEvent += spawnOnEvent;
}
diff --git a/nGJ2019/Assets/Scripts/RockJaws.cs b/nGJ2019/Assets/Scripts/RockJaws.cs
new file mode 100644
index 0000000..a161dfe
--- /dev/null
+++ b/nGJ2019/Assets/Scripts/RockJaws.cs
@@ -0,0 +1,37 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class RockJaws : MonoBehaviour
+{
+ public Transform TopJaw;
+ public Transform BottomJaw;
+ public int Speed = 10;
+ private bool reverse = false;
+ private float initialTopJawY;
+ // Start is called before the first frame update
+ void Start()
+ {
+ initialTopJawY = TopJaw.localPosition.y;
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+
+ void FixedUpdate()
+ {
+ if (TopJaw.localPosition.y < BottomJaw.localPosition.y) reverse = true;
+ else if(TopJaw.localPosition.y > initialTopJawY) reverse = false;
+
+ if (!reverse) {
+ TopJaw.Translate(0, -0.01f * Speed, 0);
+ BottomJaw.Translate(0, 0.01f * Speed, 0);
+ } else {
+ TopJaw.Translate(0, 0.01f * Speed, 0);
+ BottomJaw.Translate(0, -0.01f * Speed, 0);
+ }
+ }
+}