From 79feae7a03d06fbd845442c385c34ffebe70843e Mon Sep 17 00:00:00 2001 From: Mikkel Bybjerg Date: Sun, 28 Apr 2019 03:38:03 +0200 Subject: improved dragon and obstacle reaction correct --- .../Models/final_dragon_please_work.FBX.meta | 2 +- nGJ2019/Assets/Prefabs/CaveWalls.prefab | 4 +- nGJ2019/Assets/Prefabs/Dragon.prefab | 313 +++++++++++++++++++++ nGJ2019/Assets/Prefabs/Dragon.prefab.meta | 7 + nGJ2019/Assets/Prefabs/NarrowPassage.prefab | 38 ++- nGJ2019/Assets/Prefabs/Net.prefab | 6 +- nGJ2019/Assets/Prefabs/ObstacleRockBottom.prefab | 2 +- nGJ2019/Assets/Prefabs/ObstacleRockTop.prefab | 2 +- nGJ2019/Assets/Prefabs/RockJaws.prefab | 16 +- nGJ2019/Assets/Prefabs/Swarm_anchor.prefab | 32 +++ nGJ2019/Assets/Prefabs/Swarm_anchor.prefab.meta | 7 + nGJ2019/Assets/Prefabs/dragon_particle.prefab | 24 +- nGJ2019/Assets/Scripts/DragonMovement.cs | 83 +++++- nGJ2019/Assets/Scripts/SwarmSystem.cs | 30 +- nGJ2019/Assets/Textures/crystal_dead.mat | 24 +- nGJ2019/Assets/Textures/crystal_live.mat | 2 +- 16 files changed, 524 insertions(+), 68 deletions(-) create mode 100644 nGJ2019/Assets/Prefabs/Dragon.prefab create mode 100644 nGJ2019/Assets/Prefabs/Dragon.prefab.meta create mode 100644 nGJ2019/Assets/Prefabs/Swarm_anchor.prefab create mode 100644 nGJ2019/Assets/Prefabs/Swarm_anchor.prefab.meta diff --git a/nGJ2019/Assets/Models/final_dragon_please_work.FBX.meta b/nGJ2019/Assets/Models/final_dragon_please_work.FBX.meta index 5e17615..9b14990 100644 --- a/nGJ2019/Assets/Models/final_dragon_please_work.FBX.meta +++ b/nGJ2019/Assets/Models/final_dragon_please_work.FBX.meta @@ -63,7 +63,7 @@ ModelImporter: maskType: 3 maskSource: {instanceID: 0} additiveReferencePoseFrame: 0 - isReadable: 0 + isReadable: 1 meshes: lODScreenPercentages: [] globalScale: 1 diff --git a/nGJ2019/Assets/Prefabs/CaveWalls.prefab b/nGJ2019/Assets/Prefabs/CaveWalls.prefab index c57f273..1ce1868 100644 --- a/nGJ2019/Assets/Prefabs/CaveWalls.prefab +++ b/nGJ2019/Assets/Prefabs/CaveWalls.prefab @@ -56,7 +56,7 @@ MonoBehaviour: m_GameObject: {fileID: 7538015035249639830} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 0 @@ -82,7 +82,7 @@ MonoBehaviour: m_GameObject: {fileID: 7538015035695901050} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 0 diff --git a/nGJ2019/Assets/Prefabs/Dragon.prefab b/nGJ2019/Assets/Prefabs/Dragon.prefab new file mode 100644 index 0000000..7163a3e --- /dev/null +++ b/nGJ2019/Assets/Prefabs/Dragon.prefab @@ -0,0 +1,313 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1540055299232912362 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1540055299232912360} + - component: {fileID: 1540055299232912361} + - component: {fileID: 1540055299232912366} + - component: {fileID: 1540055299232912367} + - component: {fileID: 1540055299232912365} + m_Layer: 0 + m_Name: Dragon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1540055299232912360 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055299232912362} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -6.3, y: -0.99, z: 1.06} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5775256208097924520} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1540055299232912361 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055299232912362} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c679c8e35354b1b4abd84845391c133a, type: 3} + m_Name: + m_EditorClassIdentifier: + solids: + - {fileID: 6831756989294198273} + - {fileID: 8398687980986394140} + - {fileID: 6829653077879027395} + - {fileID: 8784228374599439413} + hurtPrefab: {fileID: 445228207040156449, guid: 3d4b5c434ac207e44953eebd411a4c3f, + type: 3} + horizontalSpeed: 0.09 + verticalSpeed: 0.12 + horizontalBound: 7.95 + verticalBound: 3.27 + healthBar: {fileID: 0} +--- !u!54 &1540055299232912366 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055299232912362} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1540055299232912367 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055299232912362} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.4 + m_Height: 5.39 + m_Direction: 0 + m_Center: {x: 0.73, y: 0.89, z: -2.49} +--- !u!114 &1540055299232912365 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055299232912362} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 888f7bff577b8164eb5f07ccefb62e5f, type: 3} + m_Name: + m_EditorClassIdentifier: + swarmPrefab: {fileID: 445228207040156449, guid: 3d4b5c434ac207e44953eebd411a4c3f, + type: 3} + anchorPrefab: {fileID: 3978565615945284120, guid: 4d7317502d499e646b99708821814925, + type: 3} + size: 100 + collapseCenter: {x: 1.99, y: 0.76, z: -2.48} + meshRender: {fileID: 6829653077879027395} + showGuides: 1 + showMesh: 0 +--- !u!1 &1540055300432422111 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1540055300432422110} + m_Layer: 0 + m_Name: tip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1540055300432422110 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055300432422111} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5848404511960919233} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1540055300993616231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1540055300993616230} + m_Layer: 0 + m_Name: tip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1540055300993616230 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1540055300993616231} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 6271300965581903002} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1540055299733487282 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1540055299232912360} + m_Modifications: + - target: {fileID: -927199367670048503, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_Name + value: final_dragon_please_work + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.43 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 90 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.x + value: 0.27564865 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.y + value: 0.27564865 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.z + value: 0.27564865 + objectReference: {fileID: 0} + - target: {fileID: 8962655216809570878, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.x + value: 3.6172235 + objectReference: {fileID: 0} + - target: {fileID: 8962655216809570878, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.y + value: 3.6172235 + objectReference: {fileID: 0} + - target: {fileID: 8962655216809570878, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + propertyPath: m_LocalScale.z + value: 3.6172235 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 89a9598fd81fa654db8c1fe9e3842481, type: 3} +--- !u!4 &5775256208097924520 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!23 &6831756989294198273 stripped +MeshRenderer: + m_CorrespondingSourceObject: {fileID: 5444894743097917619, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!23 &8398687980986394140 stripped +MeshRenderer: + m_CorrespondingSourceObject: {fileID: -2174884462299768658, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!137 &6829653077879027395 stripped +SkinnedMeshRenderer: + m_CorrespondingSourceObject: {fileID: -3776077622187685775, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!4 &6271300965581903002 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -4443008690076734936, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!4 &5848404511960919233 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -4290007637733764493, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} +--- !u!23 &8784228374599439413 stripped +MeshRenderer: + m_CorrespondingSourceObject: {fileID: -1389157037694621049, guid: 89a9598fd81fa654db8c1fe9e3842481, + type: 3} + m_PrefabInstance: {fileID: 1540055299733487282} + m_PrefabAsset: {fileID: 0} diff --git a/nGJ2019/Assets/Prefabs/Dragon.prefab.meta b/nGJ2019/Assets/Prefabs/Dragon.prefab.meta new file mode 100644 index 0000000..b0a23c7 --- /dev/null +++ b/nGJ2019/Assets/Prefabs/Dragon.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 439782ce0455fb740be2c55da31ff44f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/nGJ2019/Assets/Prefabs/NarrowPassage.prefab b/nGJ2019/Assets/Prefabs/NarrowPassage.prefab index dd3b6a0..55312f8 100644 --- a/nGJ2019/Assets/Prefabs/NarrowPassage.prefab +++ b/nGJ2019/Assets/Prefabs/NarrowPassage.prefab @@ -56,10 +56,10 @@ MonoBehaviour: m_GameObject: {fileID: 7538015035249639830} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: - type: 3 + type: 2 --- !u!65 &2761854514729097118 BoxCollider: m_ObjectHideFlags: 0 @@ -82,7 +82,33 @@ MonoBehaviour: m_GameObject: {fileID: 7538015035695901050} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 1 +--- !u!65 &3354062513162087627 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538015036993514986} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 10.2, y: 10.83, z: 3.36} + m_Center: {x: -2.83, y: -3, z: -1.27} +--- !u!114 &8527778569606939703 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538015036993514986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 3 @@ -155,6 +181,12 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 416fae093739c55499f7dcb7d4f7f2c9, type: 3} +--- !u!1 &7538015036993514986 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: 416fae093739c55499f7dcb7d4f7f2c9, + type: 3} + m_PrefabInstance: {fileID: 1998900776986113251} + m_PrefabAsset: {fileID: 0} --- !u!4 &6829481665498963961 stripped Transform: m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 416fae093739c55499f7dcb7d4f7f2c9, diff --git a/nGJ2019/Assets/Prefabs/Net.prefab b/nGJ2019/Assets/Prefabs/Net.prefab index a062489..86fd475 100644 --- a/nGJ2019/Assets/Prefabs/Net.prefab +++ b/nGJ2019/Assets/Prefabs/Net.prefab @@ -8,10 +8,10 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2575384151648682035} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 1.7593225, y: 1.677966, z: 0.020000031} + m_Size: {x: 3.65, y: 1.677966, z: 0.020000031} m_Center: {x: 0.00000047668814, y: 0.00000002980232, z: -0.010000003} --- !u!114 &3040956702141405622 MonoBehaviour: @@ -22,7 +22,7 @@ MonoBehaviour: m_GameObject: {fileID: 2575384151648682035} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 5 diff --git a/nGJ2019/Assets/Prefabs/ObstacleRockBottom.prefab b/nGJ2019/Assets/Prefabs/ObstacleRockBottom.prefab index 3e92b76..e2ff2f0 100644 --- a/nGJ2019/Assets/Prefabs/ObstacleRockBottom.prefab +++ b/nGJ2019/Assets/Prefabs/ObstacleRockBottom.prefab @@ -58,7 +58,7 @@ MonoBehaviour: m_GameObject: {fileID: 264553704504758048} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 2 diff --git a/nGJ2019/Assets/Prefabs/ObstacleRockTop.prefab b/nGJ2019/Assets/Prefabs/ObstacleRockTop.prefab index b42f9ed..06a8c5c 100644 --- a/nGJ2019/Assets/Prefabs/ObstacleRockTop.prefab +++ b/nGJ2019/Assets/Prefabs/ObstacleRockTop.prefab @@ -60,7 +60,7 @@ MonoBehaviour: m_GameObject: {fileID: 2825962919672506772} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 1 diff --git a/nGJ2019/Assets/Prefabs/RockJaws.prefab b/nGJ2019/Assets/Prefabs/RockJaws.prefab index 227238f..8267522 100644 --- a/nGJ2019/Assets/Prefabs/RockJaws.prefab +++ b/nGJ2019/Assets/Prefabs/RockJaws.prefab @@ -8,12 +8,12 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1663497088778258253} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.3735988, y: 0.36792317, z: 0.6026454} + m_Size: {x: 0.3735988, y: 0.95, z: 0.6026454} m_Center: {x: 0, y: 0, z: 0.3013227} ---- !u!114 &4918903277008153292 +--- !u!114 &2497838701390251531 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -22,7 +22,7 @@ MonoBehaviour: m_GameObject: {fileID: 1663497088778258253} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 4 @@ -34,10 +34,10 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6355416010125707379} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.3735988, y: 0.36792317, z: 0.6026454} + m_Size: {x: 0.3735988, y: 0.94, z: 0.6026454} m_Center: {x: 0, y: 0, z: 0.3013227} --- !u!114 &308759134702416259 MonoBehaviour: @@ -48,7 +48,7 @@ MonoBehaviour: m_GameObject: {fileID: 6355416010125707379} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 992985330ae614733ac43350c8ea0ab0, type: 3} + m_Script: {fileID: 11500000, guid: 59a101027e69992449080dd35f887c3b, type: 3} m_Name: m_EditorClassIdentifier: type: 4 @@ -94,7 +94,7 @@ MonoBehaviour: m_GameObject: {fileID: 8765725572880811705} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b69da2d4b545440ed86bcb8e72e0a7eb, type: 3} + m_Script: {fileID: 11500000, guid: d508cc86bb112da41aab7f9073311fe5, type: 3} m_Name: m_EditorClassIdentifier: TopJaw: {fileID: 2400053636711363934} diff --git a/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab b/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab new file mode 100644 index 0000000..fad4b31 --- /dev/null +++ b/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab @@ -0,0 +1,32 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3978565615945284120 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7426098156058727508} + m_Layer: 0 + m_Name: Swarm_anchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7426098156058727508 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3978565615945284120} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.5326667, y: -1.5476516, z: -3.4791117} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab.meta b/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab.meta new file mode 100644 index 0000000..29b9d7a --- /dev/null +++ b/nGJ2019/Assets/Prefabs/Swarm_anchor.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4d7317502d499e646b99708821814925 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/nGJ2019/Assets/Prefabs/dragon_particle.prefab b/nGJ2019/Assets/Prefabs/dragon_particle.prefab index 6e891f1..0510abf 100644 --- a/nGJ2019/Assets/Prefabs/dragon_particle.prefab +++ b/nGJ2019/Assets/Prefabs/dragon_particle.prefab @@ -59,7 +59,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3956812704593654807} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -0.143, y: 0, z: 0} m_LocalScale: {x: 0.17713054, y: 0.17713054, z: 0.17713054} m_Children: [] m_Father: {fileID: 7771521336157481751} @@ -112,7 +112,7 @@ TrailRenderer: m_Curve: - serializedVersion: 3 time: 0 - value: 0.1463004 + value: 0.30123052 inSlope: 0 outSlope: 0 tangentMode: 0 @@ -120,8 +120,8 @@ TrailRenderer: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.4998979 - value: 0.15165684 + time: 0.48891157 + value: 0.2925031 inSlope: 0 outSlope: 0 tangentMode: 0 @@ -129,8 +129,8 @@ TrailRenderer: inWeight: 0 outWeight: 0 - serializedVersion: 3 - time: 0.9210868 - value: 0 + time: 0.9155936 + value: 0.098594666 inSlope: 0 outSlope: 0 tangentMode: 0 @@ -205,17 +205,17 @@ PrefabInstance: - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: -0.143 objectReference: {fileID: 0} - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalPosition.y - value: 2.4592426 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalPosition.z - value: 1.9630866 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} @@ -260,17 +260,17 @@ PrefabInstance: - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalScale.x - value: 0.29556 + value: 0.17713054 objectReference: {fileID: 0} - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalScale.y - value: 0.29556 + value: 0.17713054 objectReference: {fileID: 0} - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} propertyPath: m_LocalScale.z - value: 0.29556 + value: 0.17713054 objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 0} diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index f3ae1d5..302a9e7 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -6,9 +6,14 @@ public class DragonMovement : MonoBehaviour { public List solids; + public GameObject hurtPrefab; + public float horizontalSpeed = 0.1f; public float verticalSpeed = 0.2f; + private Vector3 direcV = Vector3.zero; + private Vector3 deltaV = Vector3.zero; + public float horizontalBound = 6f; public float verticalBound = 4f; @@ -20,33 +25,30 @@ public class DragonMovement : MonoBehaviour private enum State {normal, swirl, slim, spread}; private State state = State.normal; + + private void applyMotion(Vector3 direc) + { + direcV = direcV + direc; + } private void moveUp() { - transform.Translate(Vector3.up * verticalSpeed); - if(transform.position.y > verticalBound) - transform.position = new Vector3(transform.position.x, verticalBound, transform.position.z); + applyMotion(Vector3.up * verticalSpeed); } private void moveDown() { - transform.Translate(Vector3.down * verticalSpeed); - if(transform.position.y < -verticalBound) - transform.position = new Vector3(transform.position.x, -verticalBound, transform.position.z); + applyMotion(Vector3.down * verticalSpeed); } private void moveLeft() { - transform.Translate(Vector3.left * horizontalSpeed); - if(transform.position.x < -horizontalBound) - transform.position = new Vector3(-horizontalBound, transform.position.y, transform.position.z); + applyMotion(Vector3.left * horizontalSpeed); } private void moveRight() { - transform.Translate(Vector3.right * horizontalSpeed); - if(transform.position.x > horizontalBound) - transform.position = new Vector3(horizontalBound, transform.position.y, transform.position.z); + applyMotion(Vector3.right * horizontalSpeed); } private void turnVisible(bool visible) @@ -169,9 +171,28 @@ public class DragonMovement : MonoBehaviour swarm.activate(false); } + void FixedUpdate() + { + transform.Translate(deltaV); + deltaV = 0.6f*deltaV + 0.4f*direcV; + direcV = Vector3.zero; + + if(transform.position.y > verticalBound) + transform.position = new Vector3(transform.position.x, verticalBound, transform.position.z); + + if(transform.position.y < -verticalBound) + transform.position = new Vector3(transform.position.x, -verticalBound, transform.position.z); + + if(transform.position.x < -horizontalBound) + transform.position = new Vector3(-horizontalBound, transform.position.y, transform.position.z); + + if(transform.position.x > horizontalBound) + transform.position = new Vector3(horizontalBound, transform.position.y, transform.position.z); + } + void Update() { - if(hurtCooldown < 0) + if(hurtCooldown > 0) hurtCooldown -= Time.deltaTime; // keyboard scheme @@ -232,12 +253,30 @@ public class DragonMovement : MonoBehaviour Gizmos.DrawWireCube(Vector3.zero, new Vector3(2*horizontalBound, 2*verticalBound, 0)); } + private IEnumerator makeGoAway(Transform t) + { + Vector3 delta = Random.onUnitSphere * Random.Range(0.03f, 0.1f); + Vector3 start = t.position; + while((start-t.position).magnitude < 3) + { + t.Translate(delta); + yield return new WaitForSeconds(0.01f); + } + Destroy(t.gameObject); + } + private void getHurt() { if(hurtCooldown <= 0) { healthBar.health--; hurtCooldown = 3; + + for(int i=0; i<30; i++) + { + Transform t = ((GameObject)Instantiate(hurtPrefab, transform.position + swarm.collapseCenter, Quaternion.identity)).transform; + StartCoroutine(makeGoAway(t)); + } } } @@ -246,7 +285,23 @@ public class DragonMovement : MonoBehaviour EnemyCollider enemy = other.gameObject.GetComponent(); if(enemy != null) { - getHurt(); + switch(enemy.type) + { + case ObstacleType.caveWalls: + case ObstacleType.rockTop: + case ObstacleType.rockBottom: + case ObstacleType.rockJaws: + getHurt(); + break; + case ObstacleType.narrowPassage: + if(state != State.slim) + getHurt(); + break; + case ObstacleType.net: + if(state != State.spread) + getHurt(); + break; + } } } diff --git a/nGJ2019/Assets/Scripts/SwarmSystem.cs b/nGJ2019/Assets/Scripts/SwarmSystem.cs index 9658a92..798cf13 100644 --- a/nGJ2019/Assets/Scripts/SwarmSystem.cs +++ b/nGJ2019/Assets/Scripts/SwarmSystem.cs @@ -6,8 +6,12 @@ public class SwarmSystem : MonoBehaviour public GameObject swarmPrefab; public GameObject anchorPrefab; public int size = 1; + public Vector3 collapseCenter; + + public SkinnedMeshRenderer meshRender; public bool showGuides = false; + public bool showMesh = false; private List units = new List(); private List anchors = new List(); @@ -20,8 +24,6 @@ public class SwarmSystem : MonoBehaviour private List boneCenterStarts = new List(); private List boneCenterDists = new List(); - private SkinnedMeshRenderer meshRender; - private List unitTris = new List(); private List> triGraph; @@ -334,8 +336,6 @@ public class SwarmSystem : MonoBehaviour void Start() { - meshRender = GetComponentInChildren(); - mapBones(); refreshMesh(); @@ -372,7 +372,9 @@ public class SwarmSystem : MonoBehaviour unit.position = anchors[u].position + Noise*noiseDirecs[u]; - Vector3 collapsedPos = Vector3.Project(unit.position - transform.position, Vector3.right) + transform.position; + Vector3 coll = transform.position + collapseCenter; + + Vector3 collapsedPos = Vector3.Project(unit.position - coll, Vector3.right)*0.3f + coll; unit.position = (1-Collapse)*unit.position + Collapse*collapsedPos; } @@ -382,8 +384,6 @@ public class SwarmSystem : MonoBehaviour { if(showGuides) { - meshRender = GetComponentInChildren(); - mapBones(); refreshMesh(); @@ -398,12 +398,13 @@ public class SwarmSystem : MonoBehaviour Mesh mesh = getCurrentMesh(); - for(int i=0; i