From 55eb37c48d195391dc2fef1d2116240f5d1f30b9 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 29 Jan 2022 15:46:44 -0800 Subject: [PATCH 01/36] Removed Sensor Toolkit Steering rig (still have a minor dependency on Sensor Toolkit though). Flight model is 90% there, committing a a checkpoint. --- Animations/DragonController.controller | 319 +++++++++----- Animations/Placeholders/Fly Backwards.anim | 53 +++ ...ards.anim.meta => Fly Backwards.anim.meta} | 0 ...Backwards.anim => Fly Down Forward L.anim} | 2 +- ...anim.meta => Fly Down Forward L.anim.meta} | 0 .../Placeholders/Fly Down Forward R.anim | 53 +++ ...anim.meta => Fly Down Forward R.anim.meta} | 0 .../{UpFly Up.anim => Fly Down.anim} | 2 +- ...pFly Down.anim.meta => Fly Down.anim.meta} | 0 Animations/Placeholders/Fly Hover.anim | 53 +++ ...ly Stand.anim.meta => Fly Hover.anim.meta} | 0 .../Placeholders/{UpFly.anim => Fly L.anim} | 2 +- .../{UpFly L.anim.meta => Fly L.anim.meta} | 0 .../Placeholders/{UpGlide.anim => Fly R.anim} | 2 +- .../{UpFly R.anim.meta => Fly R.anim.meta} | 0 .../{UpFly Stand.anim => Fly Strafe L.anim} | 2 +- ...afe L.anim.meta => Fly Strafe L.anim.meta} | 0 .../{UpFly Down.anim => Fly Strafe R.anim} | 2 +- ...afe R.anim.meta => Fly Strafe R.anim.meta} | 0 Animations/Placeholders/Fly Up Turn L.anim | 53 +++ ...rn L.anim.meta => Fly Up Turn L.anim.meta} | 0 Animations/Placeholders/Fly Up Turn R.anim | 53 +++ ...rn R.anim.meta => Fly Up Turn R.anim.meta} | 0 .../{UpFly L.anim => Fly Up.anim} | 2 +- .../{UpFly Up.anim.meta => Fly Up.anim.meta} | 0 .../Placeholders/{UpFly R.anim => Fly.anim} | 2 +- .../{UpFly.anim.meta => Fly.anim.meta} | 0 Animations/Placeholders/Glide L.anim | 53 +++ ...{UpGlide L.anim.meta => Glide L.anim.meta} | 0 Animations/Placeholders/Glide R.anim | 53 +++ ...{UpGlide R.anim.meta => Glide R.anim.meta} | 0 Animations/Placeholders/Glide.anim | 53 +++ .../{UpGlide.anim.meta => Glide.anim.meta} | 0 .../Placeholders/UpFly Down Forward L.anim | 53 --- .../Placeholders/UpFly Down Forward R.anim | 53 --- Animations/Placeholders/UpFly Strafe L.anim | 53 --- Animations/Placeholders/UpFly Strafe R.anim | 53 --- Animations/Placeholders/UpFly Up Turn L.anim | 53 --- Animations/Placeholders/UpFly Up Turn R.anim | 53 --- Animations/Placeholders/UpGlide L.anim | 53 --- Animations/Placeholders/UpGlide R.anim | 53 --- Animations/Unka.overrideController | 8 +- Prefabs/Large Creature Waypoint.prefab | 383 ++++++++++++++++ Prefabs/Large Creature Waypoint.prefab.meta | 8 + Prefabs/Waypoint Spawner.prefab | 14 +- .../wizardscode.ai.explorer.editor.asmdef | 2 +- Scripts/Runtime/BoxAreaSpawner.cs | 142 +++--- Scripts/Runtime/MoveToWaypoint.cs | 106 +++-- Scripts/Runtime/Steering.meta | 8 + Scripts/Runtime/Steering/FlyingSteeringRig.cs | 407 ++++++++++++++++++ .../Steering/FlyingSteeringRig.cs.meta | 11 + Scripts/Runtime/WayPoint.cs | 9 +- .../Runtime/wizardscode.ai.explorer.asmdef | 2 +- 53 files changed, 1609 insertions(+), 674 deletions(-) create mode 100644 Animations/Placeholders/Fly Backwards.anim rename Animations/Placeholders/{UpFly Backwards.anim.meta => Fly Backwards.anim.meta} (100%) rename Animations/Placeholders/{UpFly Backwards.anim => Fly Down Forward L.anim} (97%) rename Animations/Placeholders/{UpFly Down Forward L.anim.meta => Fly Down Forward L.anim.meta} (100%) create mode 100644 Animations/Placeholders/Fly Down Forward R.anim rename Animations/Placeholders/{UpFly Down Forward R.anim.meta => Fly Down Forward R.anim.meta} (100%) rename Animations/Placeholders/{UpFly Up.anim => Fly Down.anim} (98%) rename Animations/Placeholders/{UpFly Down.anim.meta => Fly Down.anim.meta} (100%) create mode 100644 Animations/Placeholders/Fly Hover.anim rename Animations/Placeholders/{UpFly Stand.anim.meta => Fly Hover.anim.meta} (100%) rename Animations/Placeholders/{UpFly.anim => Fly L.anim} (98%) rename Animations/Placeholders/{UpFly L.anim.meta => Fly L.anim.meta} (100%) rename Animations/Placeholders/{UpGlide.anim => Fly R.anim} (98%) rename Animations/Placeholders/{UpFly R.anim.meta => Fly R.anim.meta} (100%) rename Animations/Placeholders/{UpFly Stand.anim => Fly Strafe L.anim} (98%) rename Animations/Placeholders/{UpFly Strafe L.anim.meta => Fly Strafe L.anim.meta} (100%) rename Animations/Placeholders/{UpFly Down.anim => Fly Strafe R.anim} (98%) rename Animations/Placeholders/{UpFly Strafe R.anim.meta => Fly Strafe R.anim.meta} (100%) create mode 100644 Animations/Placeholders/Fly Up Turn L.anim rename Animations/Placeholders/{UpFly Up Turn L.anim.meta => Fly Up Turn L.anim.meta} (100%) create mode 100644 Animations/Placeholders/Fly Up Turn R.anim rename Animations/Placeholders/{UpFly Up Turn R.anim.meta => Fly Up Turn R.anim.meta} (100%) rename Animations/Placeholders/{UpFly L.anim => Fly Up.anim} (98%) rename Animations/Placeholders/{UpFly Up.anim.meta => Fly Up.anim.meta} (100%) rename Animations/Placeholders/{UpFly R.anim => Fly.anim} (98%) rename Animations/Placeholders/{UpFly.anim.meta => Fly.anim.meta} (100%) create mode 100644 Animations/Placeholders/Glide L.anim rename Animations/Placeholders/{UpGlide L.anim.meta => Glide L.anim.meta} (100%) create mode 100644 Animations/Placeholders/Glide R.anim rename Animations/Placeholders/{UpGlide R.anim.meta => Glide R.anim.meta} (100%) create mode 100644 Animations/Placeholders/Glide.anim rename Animations/Placeholders/{UpGlide.anim.meta => Glide.anim.meta} (100%) delete mode 100644 Animations/Placeholders/UpFly Down Forward L.anim delete mode 100644 Animations/Placeholders/UpFly Down Forward R.anim delete mode 100644 Animations/Placeholders/UpFly Strafe L.anim delete mode 100644 Animations/Placeholders/UpFly Strafe R.anim delete mode 100644 Animations/Placeholders/UpFly Up Turn L.anim delete mode 100644 Animations/Placeholders/UpFly Up Turn R.anim delete mode 100644 Animations/Placeholders/UpGlide L.anim delete mode 100644 Animations/Placeholders/UpGlide R.anim create mode 100644 Prefabs/Large Creature Waypoint.prefab create mode 100644 Prefabs/Large Creature Waypoint.prefab.meta create mode 100644 Scripts/Runtime/Steering.meta create mode 100644 Scripts/Runtime/Steering/FlyingSteeringRig.cs create mode 100644 Scripts/Runtime/Steering/FlyingSteeringRig.cs.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 967a997..c51cdde 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -35,7 +35,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} m_Threshold: 28 - m_Position: {x: -0.7, y: 1} + m_Position: {x: -0.7, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -43,7 +43,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} m_Threshold: 33 - m_Position: {x: 0, y: 1} + m_Position: {x: 0, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -51,12 +51,12 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} m_Threshold: 38 - m_Position: {x: 0.7, y: 1} + m_Position: {x: 0.7, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: angularVelocity + m_BlendParameter: yaw m_BlendParameterY: forwardVelocity m_MinThreshold: 13 m_MaxThreshold: 38 @@ -119,68 +119,38 @@ BlendTree: m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: angularVelocity + m_BlendParameter: yaw m_BlendParameterY: forwardVelocity m_MinThreshold: 14 m_MaxThreshold: 34 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!206 &-5110191505608462634 -BlendTree: +--- !u!1101 &-5621913499797024570 +AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Blend Tree - m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 87905e8efc51e9848a1d33a36aa95157, type: 2} - m_Threshold: 0 - m_Position: {x: -1, y: 3} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 14bbf774c9a3ed949b3f10dd1f5037e7, type: 2} - m_Threshold: 0.25 - m_Position: {x: -0, y: 6} - m_TimeScale: 1.2 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_Threshold: 0.5 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: d99d545b590dd754db3eaf4891ad104b, type: 2} - m_Threshold: 0.75 - m_Position: {x: 1, y: 3} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 18aa6846075b13e43b13bc3b3307791e, type: 2} - m_Threshold: 1 - m_Position: {x: 0, y: -4} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - m_BlendParameter: angularVelocity - m_BlendParameterY: forwardVelocity - m_MinThreshold: 0 - m_MaxThreshold: 1 - m_UseAutomaticThresholds: 1 - m_NormalizedBlendValues: 0 - m_BlendType: 1 + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: glide + m_EventTreshold: 0.4 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 3062000143290070295} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1107 &-2323046387310864844 AnimatorStateMachine: serializedVersion: 6 @@ -190,12 +160,15 @@ AnimatorStateMachine: m_PrefabAsset: {fileID: 0} m_Name: Base Layer m_ChildStates: - - serializedVersion: 1 - m_State: {fileID: 7320282026098016608} - m_Position: {x: 480, y: -220, z: 0} - serializedVersion: 1 m_State: {fileID: 7929321913217887456} - m_Position: {x: 480, y: 110, z: 0} + m_Position: {x: 470, y: 110, z: 0} + - serializedVersion: 1 + m_State: {fileID: 3062000143290070295} + m_Position: {x: 470, y: 270, z: 0} + - serializedVersion: 1 + m_State: {fileID: -1651374198255606467} + m_Position: {x: 532.09485, y: -64.83923, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -206,6 +179,57 @@ AnimatorStateMachine: m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_DefaultState: {fileID: 7929321913217887456} +--- !u!1101 &-2227351312352247077 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: glide + m_EventTreshold: 0.4 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7929321913217887456} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &-1651374198255606467 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Hover + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 @@ -215,7 +239,19 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: - - m_Name: angularVelocity + - m_Name: roll + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: pitch + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 @@ -233,6 +269,12 @@ AnimatorController: m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 9100000} + - m_Name: glide + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -246,6 +288,72 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} +--- !u!206 &2091492798866408738 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} + m_Threshold: -0.95 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} + m_Threshold: 0.9 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: yaw + m_BlendParameterY: roll + m_MinThreshold: -0.95 + m_MaxThreshold: 0.9 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!1102 &3062000143290070295 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Glide + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -2227351312352247077} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 2091492798866408738} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!206 &5237996256603445452 BlendTree: m_ObjectHideFlags: 1 @@ -257,38 +365,38 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 0.2 - m_Position: {x: -0.7, y: 0.7} + m_Position: {x: -0.6, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} - m_Threshold: 0.2888889 - m_Position: {x: 0, y: 0.85} - m_TimeScale: 1.2 + m_Threshold: 0.2761905 + m_Position: {x: 0, y: 0.7} + m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} - m_Threshold: 0.37777779 - m_Position: {x: 0.7, y: 0.7} + m_Threshold: 0.35238096 + m_Position: {x: 0.6, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} - m_Threshold: 0.4666667 - m_Position: {x: -0.6, y: 0} + m_Threshold: 0.42857146 + m_Position: {x: -0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Threshold: 0.5555556 + m_Threshold: 0.50476193 m_Position: {x: 0, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -296,15 +404,15 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} - m_Threshold: 0.64444447 - m_Position: {x: 0.6, y: 0} + m_Threshold: 0.5809524 + m_Position: {x: 0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 158e99599478daf43ae8974ce40e44d2, type: 2} - m_Threshold: 0.73333335 + m_Threshold: 0.6571429 m_Position: {x: 0, y: -1} m_TimeScale: 1 m_CycleOffset: 0 @@ -312,61 +420,35 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} - m_Threshold: 0.82222223 - m_Position: {x: -1, y: 1} + m_Threshold: 0.73333335 + m_Position: {x: -0.9, y: 0.9} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity + m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} - m_Threshold: 0.9111111 - m_Position: {x: 0, y: 1} + m_Threshold: 0.8095238 + m_Position: {x: 0, y: 0.9} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity + m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} - m_Threshold: 1 - m_Position: {x: 1, y: 1} + m_Threshold: 0.8857143 + m_Position: {x: 0.9, y: 0.9} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity + m_DirectBlendParameter: roll m_Mirror: 0 - m_BlendParameter: angularVelocity + m_BlendParameter: yaw m_BlendParameterY: forwardVelocity m_MinThreshold: 0.2 - m_MaxThreshold: 1 + m_MaxThreshold: 0.8857143 m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1102 &7320282026098016608 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Fly Level - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: [] - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: -5110191505608462634} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: --- !u!1102 &7929321913217887456 AnimatorState: serializedVersion: 6 @@ -377,7 +459,8 @@ AnimatorState: m_Name: Flight m_Speed: 1 m_CycleOffset: 0 - m_Transitions: [] + m_Transitions: + - {fileID: -5621913499797024570} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -403,7 +486,7 @@ BlendTree: m_Childs: - serializedVersion: 2 m_Motion: {fileID: -8904977728813876417} - m_Threshold: -0.7 + m_Threshold: -0.2 m_Position: {x: -1, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -412,23 +495,23 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 5237996256603445452} m_Threshold: 0 - m_Position: {x: 3, y: 0} + m_Position: {x: 0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: -6390963665721911578} - m_Threshold: 0.8 + m_Threshold: 0.2 m_Position: {x: 1, y: 0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: verticalVelocity - m_BlendParameterY: verticalVelocity - m_MinThreshold: -0.7 - m_MaxThreshold: 0.8 + m_BlendParameter: pitch + m_BlendParameterY: pitch + m_MinThreshold: -0.2 + m_MaxThreshold: 0.2 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 diff --git a/Animations/Placeholders/Fly Backwards.anim b/Animations/Placeholders/Fly Backwards.anim new file mode 100644 index 0000000..d7a4e95 --- /dev/null +++ b/Animations/Placeholders/Fly Backwards.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Backwards + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Backwards.anim.meta b/Animations/Placeholders/Fly Backwards.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Backwards.anim.meta rename to Animations/Placeholders/Fly Backwards.anim.meta diff --git a/Animations/Placeholders/UpFly Backwards.anim b/Animations/Placeholders/Fly Down Forward L.anim similarity index 97% rename from Animations/Placeholders/UpFly Backwards.anim rename to Animations/Placeholders/Fly Down Forward L.anim index 0ed349d..ffd011e 100644 --- a/Animations/Placeholders/UpFly Backwards.anim +++ b/Animations/Placeholders/Fly Down Forward L.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly Backwards + m_Name: Fly Down Forward L serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly Down Forward L.anim.meta b/Animations/Placeholders/Fly Down Forward L.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Down Forward L.anim.meta rename to Animations/Placeholders/Fly Down Forward L.anim.meta diff --git a/Animations/Placeholders/Fly Down Forward R.anim b/Animations/Placeholders/Fly Down Forward R.anim new file mode 100644 index 0000000..ac22498 --- /dev/null +++ b/Animations/Placeholders/Fly Down Forward R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Down Forward R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward R.anim.meta b/Animations/Placeholders/Fly Down Forward R.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Down Forward R.anim.meta rename to Animations/Placeholders/Fly Down Forward R.anim.meta diff --git a/Animations/Placeholders/UpFly Up.anim b/Animations/Placeholders/Fly Down.anim similarity index 98% rename from Animations/Placeholders/UpFly Up.anim rename to Animations/Placeholders/Fly Down.anim index da54396..082548d 100644 --- a/Animations/Placeholders/UpFly Up.anim +++ b/Animations/Placeholders/Fly Down.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up + m_Name: Fly Down serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly Down.anim.meta b/Animations/Placeholders/Fly Down.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Down.anim.meta rename to Animations/Placeholders/Fly Down.anim.meta diff --git a/Animations/Placeholders/Fly Hover.anim b/Animations/Placeholders/Fly Hover.anim new file mode 100644 index 0000000..1f9f8aa --- /dev/null +++ b/Animations/Placeholders/Fly Hover.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Hover + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Stand.anim.meta b/Animations/Placeholders/Fly Hover.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Stand.anim.meta rename to Animations/Placeholders/Fly Hover.anim.meta diff --git a/Animations/Placeholders/UpFly.anim b/Animations/Placeholders/Fly L.anim similarity index 98% rename from Animations/Placeholders/UpFly.anim rename to Animations/Placeholders/Fly L.anim index c52cb6f..2c41684 100644 --- a/Animations/Placeholders/UpFly.anim +++ b/Animations/Placeholders/Fly L.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly + m_Name: Fly L serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly L.anim.meta b/Animations/Placeholders/Fly L.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly L.anim.meta rename to Animations/Placeholders/Fly L.anim.meta diff --git a/Animations/Placeholders/UpGlide.anim b/Animations/Placeholders/Fly R.anim similarity index 98% rename from Animations/Placeholders/UpGlide.anim rename to Animations/Placeholders/Fly R.anim index 27e3ae8..f449991 100644 --- a/Animations/Placeholders/UpGlide.anim +++ b/Animations/Placeholders/Fly R.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpGlide + m_Name: Fly R serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly R.anim.meta b/Animations/Placeholders/Fly R.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly R.anim.meta rename to Animations/Placeholders/Fly R.anim.meta diff --git a/Animations/Placeholders/UpFly Stand.anim b/Animations/Placeholders/Fly Strafe L.anim similarity index 98% rename from Animations/Placeholders/UpFly Stand.anim rename to Animations/Placeholders/Fly Strafe L.anim index af8cb1c..67f78e6 100644 --- a/Animations/Placeholders/UpFly Stand.anim +++ b/Animations/Placeholders/Fly Strafe L.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly Stand + m_Name: Fly Strafe L serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly Strafe L.anim.meta b/Animations/Placeholders/Fly Strafe L.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Strafe L.anim.meta rename to Animations/Placeholders/Fly Strafe L.anim.meta diff --git a/Animations/Placeholders/UpFly Down.anim b/Animations/Placeholders/Fly Strafe R.anim similarity index 98% rename from Animations/Placeholders/UpFly Down.anim rename to Animations/Placeholders/Fly Strafe R.anim index 770e2b7..2772f40 100644 --- a/Animations/Placeholders/UpFly Down.anim +++ b/Animations/Placeholders/Fly Strafe R.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down + m_Name: Fly Strafe R serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly Strafe R.anim.meta b/Animations/Placeholders/Fly Strafe R.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Strafe R.anim.meta rename to Animations/Placeholders/Fly Strafe R.anim.meta diff --git a/Animations/Placeholders/Fly Up Turn L.anim b/Animations/Placeholders/Fly Up Turn L.anim new file mode 100644 index 0000000..7e3b07b --- /dev/null +++ b/Animations/Placeholders/Fly Up Turn L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Up Turn L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn L.anim.meta b/Animations/Placeholders/Fly Up Turn L.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Up Turn L.anim.meta rename to Animations/Placeholders/Fly Up Turn L.anim.meta diff --git a/Animations/Placeholders/Fly Up Turn R.anim b/Animations/Placeholders/Fly Up Turn R.anim new file mode 100644 index 0000000..f6f04e7 --- /dev/null +++ b/Animations/Placeholders/Fly Up Turn R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Up Turn R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn R.anim.meta b/Animations/Placeholders/Fly Up Turn R.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Up Turn R.anim.meta rename to Animations/Placeholders/Fly Up Turn R.anim.meta diff --git a/Animations/Placeholders/UpFly L.anim b/Animations/Placeholders/Fly Up.anim similarity index 98% rename from Animations/Placeholders/UpFly L.anim rename to Animations/Placeholders/Fly Up.anim index bba9d4c..94c99c7 100644 --- a/Animations/Placeholders/UpFly L.anim +++ b/Animations/Placeholders/Fly Up.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly L + m_Name: Fly Up serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly Up.anim.meta b/Animations/Placeholders/Fly Up.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly Up.anim.meta rename to Animations/Placeholders/Fly Up.anim.meta diff --git a/Animations/Placeholders/UpFly R.anim b/Animations/Placeholders/Fly.anim similarity index 98% rename from Animations/Placeholders/UpFly R.anim rename to Animations/Placeholders/Fly.anim index 1547ef6..64e4269 100644 --- a/Animations/Placeholders/UpFly R.anim +++ b/Animations/Placeholders/Fly.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: UpFly R + m_Name: Fly serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Animations/Placeholders/UpFly.anim.meta b/Animations/Placeholders/Fly.anim.meta similarity index 100% rename from Animations/Placeholders/UpFly.anim.meta rename to Animations/Placeholders/Fly.anim.meta diff --git a/Animations/Placeholders/Glide L.anim b/Animations/Placeholders/Glide L.anim new file mode 100644 index 0000000..72ae91d --- /dev/null +++ b/Animations/Placeholders/Glide L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Glide L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide L.anim.meta b/Animations/Placeholders/Glide L.anim.meta similarity index 100% rename from Animations/Placeholders/UpGlide L.anim.meta rename to Animations/Placeholders/Glide L.anim.meta diff --git a/Animations/Placeholders/Glide R.anim b/Animations/Placeholders/Glide R.anim new file mode 100644 index 0000000..37cd95d --- /dev/null +++ b/Animations/Placeholders/Glide R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Glide R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide R.anim.meta b/Animations/Placeholders/Glide R.anim.meta similarity index 100% rename from Animations/Placeholders/UpGlide R.anim.meta rename to Animations/Placeholders/Glide R.anim.meta diff --git a/Animations/Placeholders/Glide.anim b/Animations/Placeholders/Glide.anim new file mode 100644 index 0000000..992bc4e --- /dev/null +++ b/Animations/Placeholders/Glide.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Glide + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide.anim.meta b/Animations/Placeholders/Glide.anim.meta similarity index 100% rename from Animations/Placeholders/UpGlide.anim.meta rename to Animations/Placeholders/Glide.anim.meta diff --git a/Animations/Placeholders/UpFly Down Forward L.anim b/Animations/Placeholders/UpFly Down Forward L.anim deleted file mode 100644 index c272ca7..0000000 --- a/Animations/Placeholders/UpFly Down Forward L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down Forward L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward R.anim b/Animations/Placeholders/UpFly Down Forward R.anim deleted file mode 100644 index 758818e..0000000 --- a/Animations/Placeholders/UpFly Down Forward R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down Forward R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe L.anim b/Animations/Placeholders/UpFly Strafe L.anim deleted file mode 100644 index 6c809c3..0000000 --- a/Animations/Placeholders/UpFly Strafe L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Strafe L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe R.anim b/Animations/Placeholders/UpFly Strafe R.anim deleted file mode 100644 index 055656f..0000000 --- a/Animations/Placeholders/UpFly Strafe R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Strafe R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn L.anim b/Animations/Placeholders/UpFly Up Turn L.anim deleted file mode 100644 index cf2958a..0000000 --- a/Animations/Placeholders/UpFly Up Turn L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up Turn L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn R.anim b/Animations/Placeholders/UpFly Up Turn R.anim deleted file mode 100644 index 4f07ba9..0000000 --- a/Animations/Placeholders/UpFly Up Turn R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up Turn R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpGlide L.anim b/Animations/Placeholders/UpGlide L.anim deleted file mode 100644 index c017347..0000000 --- a/Animations/Placeholders/UpGlide L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpGlide L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpGlide R.anim b/Animations/Placeholders/UpGlide R.anim deleted file mode 100644 index 0120d00..0000000 --- a/Animations/Placeholders/UpGlide R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpGlide R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Unka.overrideController b/Animations/Unka.overrideController index 2f1736e..9e1e570 100644 --- a/Animations/Unka.overrideController +++ b/Animations/Unka.overrideController @@ -29,8 +29,6 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} @@ -43,3 +41,9 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400048, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_OverrideClip: {fileID: 7400050, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: c9b532f2b2c55b0409a5822a7aeffeb6, type: 2} + m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 6ea14cca7893ae448b5f6ecdcea029ee, type: 2} + m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 705b9cfb18289ba4ca5016d9ac206754, type: 2} + m_OverrideClip: {fileID: 7400006, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab new file mode 100644 index 0000000..978dc4d --- /dev/null +++ b/Prefabs/Large Creature Waypoint.prefab @@ -0,0 +1,383 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &105448 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 440904} + - component: {fileID: 3349790} + - component: {fileID: 13604396} + - component: {fileID: 2380250} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &440904 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 105448} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.44792253, y: 0.32641995, z: 0.44792253} + m_Children: [] + m_Father: {fileID: 460788} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3349790 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 105448} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!136 &13604396 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 105448} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &2380250 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 105448} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8caa672625832e74b8a4939c5f89ce08, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &106212 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 460788} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &460788 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 106212} + 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: + - {fileID: 440904} + - {fileID: 430804} + - {fileID: 423912} + m_Father: {fileID: 434040} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &146072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 434040} + - component: {fileID: 5192126769102148771} + - component: {fileID: 6907383477543755845} + m_Layer: 31 + m_Name: Large Creature Waypoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &434040 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 146072} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.218, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 460788} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &5192126769102148771 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 146072} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.01 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &6907383477543755845 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 146072} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1a3bf12463cfa542ae3f0b85a5baffc, type: 3} + m_Name: + m_EditorClassIdentifier: + ClearRadius: 3 + weight: 0.5 + reEnableWaitTime: 0 + NextWaypoint: {fileID: 0} +--- !u!1 &173338 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 423912} + - component: {fileID: 3344260} + - component: {fileID: 6520316} + - component: {fileID: 2354188} + m_Layer: 0 + m_Name: Cube 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &423912 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173338} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.306, z: 0} + m_LocalScale: {x: 0.515383, y: 0.16288914, z: 0.515383} + m_Children: [] + m_Father: {fileID: 460788} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3344260 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173338} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &6520316 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173338} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &2354188 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173338} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &193702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 430804} + - component: {fileID: 3361092} + - component: {fileID: 6583620} + - component: {fileID: 2347972} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &430804 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 193702} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.349, z: 0} + m_LocalScale: {x: 0.515383, y: 0.17595918, z: 0.515383} + m_Children: [] + m_Father: {fileID: 460788} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3361092 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 193702} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &6583620 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 193702} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &2347972 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 193702} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Prefabs/Large Creature Waypoint.prefab.meta b/Prefabs/Large Creature Waypoint.prefab.meta new file mode 100644 index 0000000..e22ccae --- /dev/null +++ b/Prefabs/Large Creature Waypoint.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4461efe13fc67904f8db2e5c8591aed0 +timeCreated: 1504618869 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/Waypoint Spawner.prefab b/Prefabs/Waypoint Spawner.prefab index 969c496..64373bf 100644 --- a/Prefabs/Waypoint Spawner.prefab +++ b/Prefabs/Waypoint Spawner.prefab @@ -43,14 +43,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1db34d609036b994ca87258eca785453, type: 3} m_Name: m_EditorClassIdentifier: - ToSpawn: {fileID: 146072, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - Number: 5 - SpawnInterval: 5 + ToSpawn: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} StartSpawnAmount: 2 + TotalNumber: 5 + SpawnInterval: 5 SizeX: 100 - SizeY: 10 SizeZ: 100 - ClearRadius: 1.8 + minHeight: 7 + maxHeight: 7 + AdjustToTerrainHeight: 1 + SpawnAboveWater: 1 ObstructingLayers: serializedVersion: 2 m_Bits: 1 + m_ShowAvailable: 0 + m_ShowUnavailable: 0 diff --git a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef index 6278f64..fe813d2 100644 --- a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef +++ b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef @@ -4,7 +4,7 @@ "references": [ "wizardscode.ai.explorer", "Cinemachine", - "microsmo.sensortoolkit" + "micosmo.sensortoolkit" ], "includePlatforms": [ "Editor" diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index db4129f..ef74099 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -4,13 +4,15 @@ using Random = UnityEngine.Random; using System.Linq; using UnityEngine.Serialization; +using WizardsCode.AI; namespace WizardsCode.Spawning { public class BoxAreaSpawner : MonoBehaviour { + //FIXME: generalize this so the spawner can be used for other items, not just WayPoints [SerializeField, Tooltip("The item we want to spawn using this spawner.")] - public GameObject ToSpawn; + public WayPoint ToSpawn; [SerializeField, Tooltip("The number of items to spawn at start.")] public int StartSpawnAmount; [SerializeField, Tooltip("The total number of items to have spawned. If an of the spawned items are destroyed then new ones will be spawned.")] @@ -29,12 +31,12 @@ public class BoxAreaSpawner : MonoBehaviour public float maxHeight = 7; [Header("Positioning")] - [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the terrain height at the spawn coordinates.")] - public bool AdjustToTerrainHeight = true; - [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is true then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] - public bool SpawnAboveWater = true; - [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] - public float ClearRadius = 1.8f; + [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be under the max height above the terrain or mesh objects at the coordinates.")] + [FormerlySerializedAs("AdjustToTerrainHeight")] + public bool AdjustHeight = true; + [SerializeField, Tooltip("Set to true if you want to allow spawn points below water. If false then items spawned by this spawner will have their height adjusted to be under the max height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is false then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] + [FormerlySerializedAs("SpawnAboveWater")] // changed 1/29 + public bool SpawnBelowWater = false; [SerializeField, Tooltip("The layers to look for obsructions when spawning.")] public LayerMask ObstructingLayers; @@ -46,6 +48,7 @@ public class BoxAreaSpawner : MonoBehaviour float spawnCountdown; GameObject[] spawned; + private int instanceCount; void Awake() { @@ -62,7 +65,18 @@ void Start() void OnEnable() { - StartCoroutine(SpawnRoutine()); + if (Application.isPlaying) + { + StartCoroutine(SpawnRoutine()); + } + } + + private void OnDisable() + { + if (Application.isPlaying) + { + StopAllCoroutines(); + } } IEnumerator SpawnRoutine() @@ -96,6 +110,9 @@ void Spawn() spawnCountdown = SpawnInterval; var nextSlot = nextAvailableSlot; if (nextSlot == -1) return; // No spawn slots available + + //OPTIMIZATION: Use a pool + WayPoint go = Instantiate(ToSpawn) as WayPoint; int nTrys = 0; Vector3 pos; @@ -107,22 +124,28 @@ void Spawn() Debug.LogWarning("Failed to find spawn location after 10 tries, aborting.", gameObject); return; } - pos = ChooseLocation(); - } while (LocationIsObstructed(pos)); + pos = ChooseLocation(go); + } while (LocationIsObstructed(pos, go)); - var newInst = Instantiate(ToSpawn, pos, transform.rotation) as GameObject; - newInst.transform.SetParent(transform.parent); - spawned[nextSlot] = newInst; + go.transform.SetPositionAndRotation(pos, transform.rotation); + go.name += instanceCount++; + go.transform.SetParent(transform.parent); + spawned[nextSlot] = go.gameObject; } - Vector3 ChooseLocation() + /// + /// Shoose a suitable location for an object to spawn. + /// + /// + /// + Vector3 ChooseLocation(WayPoint go) { Vector3 dimensions = new Vector3(SizeX / 2f, maxHeight - minHeight, SizeZ / 2f); Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 pos = Vector3.Scale(dimensions, randNormalizedVector) + transform.position; pos.y += minHeight; - pos = GetHeightAdjusted(pos); + pos = GetHeightAdjusted(pos, go); return pos; } @@ -130,61 +153,56 @@ Vector3 ChooseLocation() /// /// Adjust the height of a position in the terrain to allow for any obstructions on the terrain. /// - /// + /// The approximate position the object should be placed + /// The game object to place at the position /// - private Vector3 GetHeightAdjusted(Vector3 pos) + private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) { - if (!AdjustToTerrainHeight && !SpawnAboveWater) return pos; - - float clearance = (ClearRadius * 1.05f); + if (!AdjustHeight && SpawnBelowWater) return pos; - if (AdjustToTerrainHeight) + float clearance; + if (go == null) { - Terrain terrain = null; - if (Terrain.activeTerrains.Length == 1) - { - terrain = Terrain.activeTerrain; - } - else - { - terrain = Terrain.activeTerrains.OrderBy(x => - { - Vector3 terrainPosition = x.transform.position; - Vector3 terrainSize = x.terrainData.size * 0.5f; - Vector3 terrainCenter = new Vector3(terrainPosition.x + terrainSize.x, terrainPosition.y, terrainPosition.z + terrainSize.z); - return Vector3.SqrMagnitude(terrainCenter - pos); - }).First(); - } + clearance = 0.2f; + } + else + { + clearance = (go.ClearRadius * 1.05f); + } - if (terrain != null) - { - float terrainHeight = terrain.SampleHeight(pos); + //TODO: consider using just raycast, do we really need to measure terrain heigh. Consider that this will not take into account items onthe terrain, + RaycastHit hit; + float height = 0; + bool hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); + if (hasHit) + { + height = hit.distance; - if (pos.y < terrainHeight + clearance) + if (AdjustHeight) + { + if (pos.y < height + clearance) { - pos.y = terrain.transform.position.y + terrainHeight + clearance; - } else if (pos.y - terrainHeight > maxHeight) + pos.y = height + clearance; + } + else if (pos.y - height > maxHeight) { - pos.y = terrain.transform.position.y + Random.Range(terrainHeight + clearance, terrainHeight + maxHeight); + pos.y = height + Random.Range(height + clearance, height + maxHeight); + } + else + { + Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below it. Relying on the initial spawn positions height."); } } - else - { - Debug.LogError($"No terrain found for {pos} while AdjustToTerrainheight is true."); - } - } - if (SpawnAboveWater) - { - RaycastHit hit; - if (Physics.Raycast(pos, Vector3.up, out hit, Mathf.Infinity)) + if (!SpawnBelowWater) { float waterHeight = hit.distance; if (pos.y < waterHeight + clearance) { pos.y = waterHeight + clearance; - } else if (pos.y - waterHeight > maxHeight) + } + else if (pos.y - waterHeight > maxHeight) { pos.y = waterHeight + Random.Range(clearance, maxHeight); } @@ -194,9 +212,9 @@ private Vector3 GetHeightAdjusted(Vector3 pos) return pos; } - bool LocationIsObstructed(Vector3 location) + bool LocationIsObstructed(Vector3 location, WayPoint go) { - return Physics.CheckSphere(location, ClearRadius, ObstructingLayers); + return Physics.CheckSphere(location, go.ClearRadius, ObstructingLayers); } public void OnDrawGizmosSelected() @@ -211,10 +229,13 @@ public void OnDrawGizmosSelected() // Red sphere marking the center of the box Gizmos.color = Color.red; - Gizmos.DrawSphere(GetHeightAdjusted(transform.position), Mathf.Max(0.2f, ClearRadius)); + Gizmos.DrawSphere(GetHeightAdjusted(transform.position, null), Mathf.Max(0.2f, 0.2f)); if (m_ShowAvailable || m_ShowUnavailable) { + //OPTIMIZATION: Use a cached sample object (See start of method as well) + WayPoint go = Instantiate(ToSpawn) as WayPoint; + float depth = SizeX / 2; float xInterval = Mathf.Max(0.3f, SizeX / 20); float height = maxHeight / 2; @@ -230,13 +251,13 @@ public void OnDrawGizmosSelected() { { Vector3 pos = transform.position + new Vector3(-width + x, -height + y, -depth + z); - pos = GetHeightAdjusted(pos); - if (m_ShowAvailable && !LocationIsObstructed(pos)) + pos = GetHeightAdjusted(pos, go); + if (m_ShowAvailable && !LocationIsObstructed(pos, go)) { Gizmos.color = Color.green; Gizmos.DrawSphere(pos, 0.2f); } - else if (m_ShowUnavailable && LocationIsObstructed(pos)) + else if (m_ShowUnavailable && LocationIsObstructed(pos, go)) { Gizmos.color = Color.red; Gizmos.DrawSphere(pos, 0.2f); @@ -245,6 +266,9 @@ public void OnDrawGizmosSelected() } } } + + //OPTIMIZATION: Use a cached sample object (See start of method as well) + DestroyImmediate(go); } } } diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 66cfeda..c82e67a 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -14,29 +14,28 @@ enum SelectionStrategy { nearest, furthest, random }; [Header("Sensors")] [SerializeField, Tooltip("The sensor for detecting waypoints.")] - Sensor WaypointSensor; + RangeSensor m_WaypointSensor; [SerializeField, Tooltip("The sensor for detecting when the target waypoint has been reached.")] - Sensor WaypoinArrivalSensor; + TriggerSensor m_WaypoinArrivalSensor; [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] - WayPoint waypointPrefab; + WayPoint m_waypointPrefab; [SerializeField, Tooltip("Strategy for selecting the next waypoint when one is not currently selected.")] - SelectionStrategy strategy = SelectionStrategy.nearest; + SelectionStrategy m_SelectionStrategy = SelectionStrategy.nearest; [SerializeField, Tooltip("Randomness in the selection of the next waypoint. The higher this value the more randomness there will be."), Range(0f, 1f)] - float randomness = 0.2f; + float m_SelectionRandomness = 0.2f; + /* [SerializeField, Tooltip("The radius that is used for the turning circle of the body. 0 means the body can turn on the spot. Note that a turning radius that is too close to the Waypoint Arrival sensor range will likely cause problems.")] [Range(0f, 100f)] - float turningRadius = 15; + float m_TurningRadius = 15; + */ [Header("Steering")] [SerializeField, Tooltip("The rig for steering towards the currently selected waypoint.")] - [FormerlySerializedAs("Steering")] // changed 1/23/22 - SteeringRig SteeringRig; + FlyingSteeringRig m_SteeringRig; [SerializeField, Tooltip("How long should the object be in the same place, if it has an existing waypoint destination, before it is assumed to be stuck. When stuck a new waypoint will be created a few meters away roughly behind the current position.")] - float stuckDuration = 0.5f; + float m_StuckDuration = 0.5f; [SerializeField, Tooltip("The tolerance to use when deciding if the item is stuck. If the object moves more than this distance in any direction in the `stuckDuration` then it will be considered to be moving.")] - float stuckTolerance = 0.05f; - [SerializeField, Tooltip("If set to true the sensor rig will be set to rotate towards the selected target waypoint.")] - bool faceTowardsTarget = false; + float m_StuckTolerance = 0.05f; [Header("Arrival Behaviours")] [SerializeField, Tooltip("If you have [Photo Session](https://github.com/TheWizardsCode/PhotoSession) and this setting is true then a new photo will be taken each time the target reaches a waypoint. " + @@ -62,10 +61,10 @@ private void Start() { if (m_RandomizeStartingPosition) { - WaypointSensor.Pulse(); - if (WaypointSensor.DetectedObjects.Count > 0) + m_WaypointSensor.Pulse(); + if (m_WaypointSensor.DetectedObjects.Count > 0) { - WayPoint start = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); + WayPoint start = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); if (start) { transform.position = start.transform.position; @@ -74,8 +73,8 @@ private void Start() } } - timeToStuck = stuckDuration; - sqrStuckTolerance = stuckTolerance * stuckTolerance; + timeToStuck = m_StuckDuration; + sqrStuckTolerance = m_StuckTolerance * m_StuckTolerance; #if PHOTOSESSION_PRESENT photoSession = GameObject.FindObjectOfType(); @@ -97,17 +96,9 @@ WayPoint currentWaypoint if (m_currentWaypoint != value) { m_currentWaypoint = value; - if (m_currentWaypoint != null) + if (currentWaypoint != null && m_SteeringRig != null) { - SteeringRig.IgnoreList.Clear(); - SteeringRig.IgnoreList.Add(m_currentWaypoint.gameObject); - SteeringRig.IgnoreList.Add(gameObject); - SteeringRig.DestinationTransform = m_currentWaypoint.transform; - - if (faceTowardsTarget) - { - SteeringRig.FaceTowardsTransform = m_currentWaypoint.transform; - } + m_SteeringRig.destination = currentWaypoint.transform; } } } @@ -123,7 +114,7 @@ bool IsStuck } else { oldPosition = transform.position; - timeToStuck = stuckDuration; + timeToStuck = m_StuckDuration; } return timeToStuck <= 0; @@ -136,23 +127,24 @@ void Update() { OnWaypointArrival(); - Vector3 pos = -transform.forward * Random.Range(SteeringRig.StoppingDistance * 2.5f, SteeringRig.StoppingDistance * 3.5f); + Vector3 pos = -transform.forward * Random.Range(2.5f, 3.5f); pos += transform.right * Random.Range(-0.5f, -0.5f); pos += transform.up * Random.Range(0.5f, 1f); - GameObject go = Instantiate(waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); + + GameObject go = Instantiate(m_waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); go.name = stuckWaypointName; currentWaypoint = go.GetComponent(); oldPosition = transform.position; - timeToStuck = stuckDuration; + timeToStuck = m_StuckDuration; - WaypointSensor.Pulse(); + m_WaypointSensor.Pulse(); } if (!currentWaypoint) { SelectNewWaypoint(); } - else if (WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) + else if (m_WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) { OnWaypointArrival(); } @@ -181,7 +173,7 @@ private void OnWaypointArrival() { currentWaypoint.Disable(); } - WaypointSensor.Pulse(); + m_WaypointSensor.Pulse(); lastWaypoint = currentWaypoint; currentWaypoint = null; @@ -221,7 +213,7 @@ private void SelectNewWaypoint() } else { - switch (strategy) + switch (m_SelectionStrategy) { case SelectionStrategy.nearest: currentWaypoint = GetWeightedNearestFromPointWithComponent(transform.position); @@ -230,54 +222,51 @@ private void SelectNewWaypoint() currentWaypoint = GetWeightedFurthestFromPointWithComponent(transform.position); break; case SelectionStrategy.random: - if (WaypointSensor.DetectedObjects.Count > 0) + if (m_WaypointSensor.DetectedObjects.Count > 0) { - currentWaypoint = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); + currentWaypoint = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); } break; default: - Debug.LogError("Unknown selection strategy: " + strategy); + Debug.LogError("Unknown selection strategy: " + m_SelectionStrategy); break; } } } - if (currentWaypoint == null || turningRadius == 0) return; + if (currentWaypoint == null) return; + /* create a turning circle if the next waypoint will cause the body to flip Transform root = transform.root; Vector3 heading = currentWaypoint.transform.position - root.position; - float dot = Vector3.Dot(heading, root.forward); - if ( dot < 0.5) + float dot = Vector3.Dot(heading.normalized, root.forward.normalized); + if ( dot < 0.3) { nextWaypoint = currentWaypoint; - currentWaypoint = Instantiate(waypointPrefab); + currentWaypoint = Instantiate(m_waypointPrefab); currentWaypoint.name = $"Turning waypoint (heading to {nextWaypoint})."; - Vector3 leftRight = Vector3.zero; - if (Vector3.SignedAngle(currentWaypoint.transform.position, root.position, Vector3.up) > 0) { - leftRight = root.right; - } else - { - leftRight = -root.right; - } + currentWaypoint.reEnableWaitTime = 0; - Vector3 pos = transform.position + (leftRight * turningRadius) + (root.forward * turningRadius); + //TODO: Don't always turn right, decide the least obstructed path and go that way + Vector3 pos = transform.position + (root.right * m_TurningRadius) + (root.forward * m_TurningRadius) + (root.up * 2); //FIXME: this needs to be set at a height above the terrain as there is a danger that it will be set into a slope and be inacessible pos.y = root.position.y; currentWaypoint.transform.position = pos; } + */ } private WayPoint GetWeightedFurthestFromPointWithComponent(Vector3 point) { WayPoint furthest = null; var furthestDistance = 0f; - var gos = WaypointSensor.DetectedObjectsOrderedByDistance; + var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = waypoint.weight + Random.Range(0, randomness); + float weight = waypoint.weight + Random.Range(0, m_SelectionRandomness); var weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (furthest == null || weightedDistance > furthestDistance) { @@ -292,13 +281,13 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) { WayPoint nearest = null; var nearestDistance = 0f; - var gos = WaypointSensor.DetectedObjectsOrderedByDistance; + var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = 1.001f - (waypoint.weight + Random.Range(0, randomness)); + float weight = 1.001f - (waypoint.weight + Random.Range(0, m_SelectionRandomness)); float weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (nearest == null || weightedDistance < nearestDistance) @@ -309,5 +298,14 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) } return nearest; } + + private void OnValidate() + { + if (m_SteeringRig == null) m_SteeringRig = GetComponentInChildren(); + + if (m_WaypointSensor == null) m_WaypointSensor = GetComponentInChildren(); + + if (m_WaypoinArrivalSensor == null) m_WaypoinArrivalSensor = GetComponentInChildren(); + } } } \ No newline at end of file diff --git a/Scripts/Runtime/Steering.meta b/Scripts/Runtime/Steering.meta new file mode 100644 index 0000000..e1d9653 --- /dev/null +++ b/Scripts/Runtime/Steering.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 02d79118dc6dd654bae35c79397bd79f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs new file mode 100644 index 0000000..33cd909 --- /dev/null +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -0,0 +1,407 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +namespace WizardsCode.AI +{ + /// + /// This rig provides a 3D navigation for flying creatures and objects. It detects opstacles on the expected path an flies over + /// them or around them if it can. + /// + public class FlyingSteeringRig : MonoBehaviour + { + [Header("Flight Controls")] + [SerializeField, Tooltip("The rigid body that forces will be applied to to make the object fly (or fall in the case of gravity).")] + internal Rigidbody rigidbody; + [SerializeField, Tooltip("Once the object is within this distance of the destination it is considered to have reached the destination.")] + float m_ArrivalDistance = 1; + [SerializeField, Tooltip("The maximum toque (turning force) that can be applied to this body. Higher values will result in tighter turns.")] + float m_MaxTorque = 4; + [SerializeField, Tooltip("The maximum strafe (sideways and backwards) force that can be applied to this body. Larger values will allow the body to slide sideways and backwards. A value of 0 will result in the body only moving forward, thus requiring a turn to move sideways or backwards from the current position.")] + float m_MaxStrafeForce = 5; + [SerializeField, Tooltip("The maximum vertical force that can be applied to this body. Larger values will result in faster climbs and dives.")] + float m_MaxVerticalForce = 8; + [SerializeField, Tooltip("The maximum forward force that can be applied to this body. Larger values will result in faster movement.")] + float m_MaxForwardForce = 10; + [SerializeField, Tooltip("The maximum forward velocity for this body.")] + internal float maxSpeed = 8; + [SerializeField, Tooltip("How sensitive the body is to obstacles. Lower numbers mean the body will move closer to obstacles. Set this high enough that the model does not clip objects, the larger the model the higher this value needs to be.")] + [Range(0.1f, 6f)] + float m_AvoidanceSensitivity = 1f; + [SerializeField, Tooltip("The maximum distance that can be steered from the target direction. Setting this higher will allow the body to go more away from a direct line to the target.")] + [Range(1f, 5f)] + float m_MaxAvoidanceLength = 2f; + [SerializeField, Tooltip("The body will attempt to avoid colliders on these layers.")] + LayerMask m_AvoidanceLayers; + + [Header("Height Management")] + [SerializeField, Tooltip("Try to keep the camera within a certain height range (true) or allow any height (false)." + + " If this is true the following settings will confine the height.")] + bool m_MaintainHeight = true; + [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + + " should be. This is used as a validation check to ensure the object is not going below" + + " the terrain or through a mesh obstacles in the scene.")] + float m_MinHeight = 1.5f; + [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + + " should be. This is used as a validation check to ensure the object is not going too" + + " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + + " but if it does it will have forces placed upon it to move down.")] + float m_MaxHeight = 10f; + [SerializeField, Tooltip("The optimal height above the ground or nearest obstacle that this rig" + + " should be. The camera is allowed to move from this height but it will recieve gentle forces" + + " encourage it to return to this height.")] + float m_OptimalHeight = 2f; + [SerializeField, Tooltip("The maximum climb angle that this body can gain vertical height with. 90 is vertically up.")] + [Range(0, 90)] + float m_MaxClimbAngle = 35; + [SerializeField, Tooltip("The maximum dive angle that this body can lose vertical height with in a controlled way. 90 is stright down.")] + [Range(0, 90)] + float m_MaxDiveAngle = 75; + + [Header("Animation")] + [SerializeField, Tooltip("The animation controller for updating speed accordingly.")] + private Animator m_Animator; + + private float originalAnimationSpeed; + private static Mesh cylinderCache; + private Sensor[] sensorArray; + + /// + /// The transform of the current destination the object is flying to. + /// + public Transform destination { get; set; } + + private void Awake() + { + ConfigureSensors(); + } + + private void ConfigureSensors() + { + List sensors = new List(); + sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 0.5f, m_AvoidanceLayers)); // forward + sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/left + sensors.Add(new Sensor(transform.forward - transform.right, 0.5f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/left + sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/left/left + sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/right + sensors.Add(new Sensor(transform.forward + transform.right, 0.5f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right + sensors.Add(new Sensor(transform.forward + transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/right/right + + sensors.Add(new Sensor(-transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // left + sensors.Add(new Sensor(transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // right + + sensors.Add(new Sensor(transform.up, 0, maxSpeed * 0.5f, m_AvoidanceLayers)); // up + sensors.Add(new Sensor(transform.up + transform.forward, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/forward + sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/left + sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/right + + sensors.Add(new Sensor(-transform.up, 0, m_MinHeight, m_AvoidanceLayers)); // down + sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/left + sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/right + sensorArray = sensors.ToArray(); + } + + /// + /// Get a direction that will push the object away from detected obstacles. + /// + Vector3 GetCalculateRepulsionDirection() + { + Vector3 strength = Vector3.zero; + + for (int i = 0; i < sensorArray.Length; i++) + { + strength += CheckRepulsionFrom(sensorArray[i]); + } + + return strength * Mathf.Clamp(strength.magnitude, 0, m_MaxAvoidanceLength); + } + + private Vector3 CheckRepulsionFrom(Sensor sensor) + { + //OPTIMIZATION: don't pulse every frame + if (sensor.Pulse(this)) + { + float obstructionRatio = Mathf.Pow(1f - (sensor.hit.distance / sensor.maxLength), 1f / m_AvoidanceSensitivity); + return obstructionRatio * sensor.hit.normal; + } + else + { + return Vector3.zero; + } + } + private void Start() + { + if (m_Animator) + { + originalAnimationSpeed = m_Animator.speed; + } + } + + /// + /// Get an angle around the x axis that will push the object back to the optimal height if + /// not already there. The angle will be the maximum + /// allowable vertical climb or dive angle proportional to the required + /// height change. However, if the current waypoint requires requires a different height from + /// the optimal height then this will return 0. + /// + float GetHeightAdjustmentAngle() + { + if (!m_MaintainHeight) return 0; + + RaycastHit hit; + float height = 0; + if (Physics.Raycast(rigidbody.transform.position, Vector3.down, out hit, Mathf.Infinity)) + { + height = hit.distance; + } + else + { + Debug.LogWarning($"{name} has `Maintain Height` enabled but therre is no raycast hit below it. Relying on Steering Behaviours to keep things in order."); + return 0; + } + + float angle = 0; + if (height < m_OptimalHeight) + { + if (height < m_MinHeight) + { + angle = Mathf.Lerp(0, m_MaxClimbAngle, Mathf.Clamp01((m_MinHeight - height) / m_MinHeight)); + } + else + { + angle = Mathf.Lerp(0, m_MaxClimbAngle, Mathf.Clamp01((m_OptimalHeight - height) / m_OptimalHeight)); + } + } else if (height > m_OptimalHeight) + { + if (destination.position.y > m_OptimalHeight) return 0; + + if (height > m_MaxHeight) { + //do angle dot thingy here + angle = Mathf.Lerp(-m_MaxDiveAngle, 0, Mathf.Clamp01((height - m_MaxHeight) / m_MaxHeight)); + } + else + { + angle = Mathf.Lerp(-m_MaxDiveAngle, 0, Mathf.Clamp01((height - m_OptimalHeight) / m_OptimalHeight)); + } + } + + return angle; + } + private bool hasReachedDestination + { + get + { + return (rigidbody.transform.position - destination.position).magnitude <= m_ArrivalDistance; + } + } + protected virtual void FixedUpdate() + { + if (destination == null) return; + + if (hasReachedDestination) + { + destination = null; + return; + } + + Vector3 desiredDirection = (destination.position - rigidbody.transform.position); + Vector3 moveDirection = Vector3.zero; + if (desiredDirection.sqrMagnitude > 1) + { + moveDirection += desiredDirection.normalized; + } else + { + moveDirection += desiredDirection; + } + + Vector3 repulsion = GetCalculateRepulsionDirection(); + if (repulsion.sqrMagnitude > 0.01f) + { + moveDirection += repulsion.normalized; + } else + { + moveDirection += repulsion * 100; + } + + Quaternion heightRotation = Quaternion.Euler(GetHeightAdjustmentAngle(), 0, 0); + moveDirection = heightRotation * moveDirection; + + // Rotate towards the desired direction + float angle; + Vector3 axis; + Quaternion desiredRotation = Quaternion.FromToRotation(rigidbody.transform.forward, moveDirection); + desiredRotation.ToAngleAxis(out angle, out axis); + angle = angle > 180f ? angle - 360f : angle; + var torque = Mathf.Clamp(angle / 20f, -1f, 1f) * m_MaxTorque; + rigidbody.AddTorque(axis * torque); + + + // Keep the bottom facing down + float z = rigidbody.rotation.eulerAngles.z; + if (z > 180f) z -= 360f; + float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; + rigidbody.AddTorque(rigidbody.transform.forward * -force); + + SetAnimationParameters(moveDirection); + + // Forward force to add + float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); + float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); + + // Vertical force to add + float verticalDotMove = Vector3.Dot(Vector3.up, moveDirection.normalized); + float verticalForce = 0; + if (verticalDotMove > 0) { + verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); + } else + { + verticalForce = Mathf.Lerp(0, -m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); + } + + // Add the forces + rigidbody.AddForce((forwardForce * moveDirection.normalized) + + (verticalForce * rigidbody.transform.up)); + + // Don't go over maximum speed + rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed); + } + + void SetAnimationParameters(Vector3 moveDirection) + { + if (!m_Animator) return; + + Quaternion q = rigidbody.rotation; + float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); + float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); + float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); + + float pitch; + if (pitchRad <= 0) // up + { + pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxClimbAngle; + } else + { + pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxDiveAngle; + } + float yaw = yawRad / 1.52f; + float roll = rollRad / 3.14f; + float strafeVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.x; + float verticalVelocity = rigidbody.velocity.normalized.y; + float forwardVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.z; + + bool glide = false; + if (forwardVelocity > 0.9) + { + glide = pitch > -0.2 && pitch < 0.2; + } + + //OPTIMIZATION: Use Hash not string + m_Animator.SetFloat("yaw", strafeVelocity); + if (pitch <= 0) // up + { + m_Animator.SetFloat("pitch", pitch); + } else // down + { + m_Animator.SetFloat("pitch", pitch); + } + m_Animator.SetFloat("roll", roll); + m_Animator.SetFloat("verticalVelocity", verticalVelocity); + m_Animator.SetFloat("forwardVelocity", forwardVelocity); + m_Animator.SetBool("glide", glide); + } + + private void OnDrawGizmosSelected() + { + // Target Direction + if (destination != null) + { + Gizmos.color = Color.yellow; + Gizmos.DrawLine(rigidbody.transform.position, destination.position); + } + + // Sensors + if (sensorArray == null || sensorArray.Length == 0) ConfigureSensors(); + + for (int i = 0; i < sensorArray.Length; i++) + { + Vector3 direction = rigidbody.transform.TransformDirection(sensorArray[i].sensorDirection); + float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rigidbody.velocity.magnitude / maxSpeed)); + + Vector3 endPoint; + if (sensorArray[i].hit.collider == null) + { + endPoint = rigidbody.position + (direction * length); + Gizmos.color = Color.green; + } else + { + endPoint = rigidbody.position + (direction * sensorArray[i].hit.distance); + Gizmos.color = Color.red; + } + + if (sensorArray[i].radius > 0) + { + Gizmos.DrawLine(rigidbody.position, endPoint); + Gizmos.DrawWireSphere(endPoint, sensorArray[i].radius); + } + else + { + Gizmos.DrawLine(rigidbody.position, endPoint); + } + } + } + private void OnValidate() + { + if (rigidbody == null) rigidbody = GetComponentInParent(); + } + } + + class Sensor + { + private bool obstructionHit = false; + + /// + /// The RaycastHit or null depending on whether the sensor hit anything on the last pulse + /// + public RaycastHit hit; + + /// + /// Direction relative to `transform.forward`. + /// + public Vector3 sensorDirection { get; set; } + public float radius { get; set; } + public float maxLength { get; set; } + + private LayerMask avoidanceLayers; + + public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoidanceLayers) { + this.sensorDirection = direction; + this.radius = radius; + this.maxLength = maxLength; + this.avoidanceLayers = avoidanceLayers; + } + + /// + /// Check for obstructions in the sensor. Once pulsed the value of `hit` + /// will be the `RaycastHit` returned by the testing raycast. + /// The rig from which the sensors should be fired. + /// + public bool Pulse(FlyingSteeringRig rig) + { + Vector3 direction = rig.rigidbody.transform.TransformDirection(this.sensorDirection); + float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rigidbody.velocity.magnitude / rig.maxSpeed)); + + Ray ray = new Ray(rig.rigidbody.transform.position, direction); + if (radius > 0) + { + obstructionHit = Physics.SphereCast(ray, radius, out hit, length, avoidanceLayers); + } + else + { + obstructionHit = Physics.Raycast(ray, out hit, length, avoidanceLayers); + } + + return obstructionHit; + } + } +} diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs.meta b/Scripts/Runtime/Steering/FlyingSteeringRig.cs.meta new file mode 100644 index 0000000..943240d --- /dev/null +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4b518057b1f88040bff8e428a6b028d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Runtime/WayPoint.cs b/Scripts/Runtime/WayPoint.cs index cf8c23e..4ef8670 100644 --- a/Scripts/Runtime/WayPoint.cs +++ b/Scripts/Runtime/WayPoint.cs @@ -13,9 +13,11 @@ namespace WizardsCode.AI /// public class WayPoint : MonoBehaviour { + [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] + public float ClearRadius = 1.8f; [SerializeField, Tooltip("The relative weight of this waypoint in terms of it's interest. A higher value will increase the chances of this waypoint being selected all other choice factors being equal."), Range(0.001f, 1f)] internal float weight = 0.5f; - [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will not be re-enabled.")] + [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will destroyed once visited.")] internal float reEnableWaitTime = 0; [SerializeField, Tooltip("If set the next waypoint selected will be the one set here, assuming that it is still present in the scene.")] public WayPoint NextWaypoint; @@ -70,6 +72,9 @@ public void Disable() if (reEnableWaitTime > 0) { timeToReEnable = Time.timeSinceLevelLoad + reEnableWaitTime; + } else + { + Destroy(this.gameObject); } } @@ -85,7 +90,7 @@ public void Enable() private void OnDrawGizmos() { Gizmos.color = Color.blue; - Gizmos.DrawSphere(transform.position, 0.2f); + Gizmos.DrawSphere(transform.position, ClearRadius); } } } \ No newline at end of file diff --git a/Scripts/Runtime/wizardscode.ai.explorer.asmdef b/Scripts/Runtime/wizardscode.ai.explorer.asmdef index b64ab86..b8fb5b5 100644 --- a/Scripts/Runtime/wizardscode.ai.explorer.asmdef +++ b/Scripts/Runtime/wizardscode.ai.explorer.asmdef @@ -3,7 +3,7 @@ "rootNamespace": "", "references": [ "PhotoSession.Runtime", - "microsmo.sensortoolkit" + "micosmo.sensortoolkit" ], "includePlatforms": [], "excludePlatforms": [], From 14c34da9f70694554c601e4249132c836d4b8cb7 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 29 Jan 2022 19:58:19 -0800 Subject: [PATCH 02/36] Allow individual sensors to have custom sensitivities. Remove the separate height checks and use a low sensitivity ray instead. Fix a bug in the spawner that resulted in some spawns going underground. --- Animations/DragonController.controller | 74 ++++++---------- Scripts/Runtime/BoxAreaSpawner.cs | 4 +- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 88 +++++-------------- 3 files changed, 48 insertions(+), 118 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index c51cdde..6ce4939 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -11,7 +11,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} m_Threshold: 13 - m_Position: {x: -0.5, y: 0} + m_Position: {x: -0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -19,7 +19,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} m_Threshold: 18 - m_Position: {x: 0, y: 0} + m_Position: {x: 0, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -27,7 +27,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_Threshold: 23 - m_Position: {x: 0.5, y: 0} + m_Position: {x: 0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -35,7 +35,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} m_Threshold: 28 - m_Position: {x: -0.7, y: 0.8} + m_Position: {x: -0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -43,7 +43,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} m_Threshold: 33 - m_Position: {x: 0, y: 0.8} + m_Position: {x: 0, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -51,13 +51,13 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} m_Threshold: 38 - m_Position: {x: 0.7, y: 0.8} + m_Position: {x: 0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 m_BlendParameter: yaw - m_BlendParameterY: forwardVelocity + m_BlendParameterY: verticalVelocity m_MinThreshold: 13 m_MaxThreshold: 38 m_UseAutomaticThresholds: 0 @@ -83,7 +83,7 @@ BlendTree: m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Threshold: 18 m_Position: {x: 0, y: 0} - m_TimeScale: 1.5 + m_TimeScale: 1.4 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 @@ -98,7 +98,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} m_Threshold: 26 - m_Position: {x: -0.7, y: 1} + m_Position: {x: -0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -106,7 +106,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} m_Threshold: 30 - m_Position: {x: 0, y: 1} + m_Position: {x: 0, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -114,13 +114,13 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_Threshold: 34 - m_Position: {x: 0.7, y: 1} + m_Position: {x: 0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 m_BlendParameter: yaw - m_BlendParameterY: forwardVelocity + m_BlendParameterY: pitch m_MinThreshold: 14 m_MaxThreshold: 34 m_UseAutomaticThresholds: 0 @@ -365,30 +365,30 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 0.2 - m_Position: {x: -0.6, y: 0.7} + m_Position: {x: -0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} - m_Threshold: 0.2761905 - m_Position: {x: 0, y: 0.7} + m_Threshold: 0.2979592 + m_Position: {x: 0, y: 0.5} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} - m_Threshold: 0.35238096 - m_Position: {x: 0.6, y: 0.7} + m_Threshold: 0.39591837 + m_Position: {x: 0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} - m_Threshold: 0.42857146 + m_Threshold: 0.4938776 m_Position: {x: -0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -396,7 +396,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Threshold: 0.50476193 + m_Threshold: 0.59183675 m_Position: {x: 0, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -404,7 +404,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} - m_Threshold: 0.5809524 + m_Threshold: 0.689796 m_Position: {x: 0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -412,40 +412,16 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 158e99599478daf43ae8974ce40e44d2, type: 2} - m_Threshold: 0.6571429 + m_Threshold: 0.78775513 m_Position: {x: 0, y: -1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} - m_Threshold: 0.73333335 - m_Position: {x: -0.9, y: 0.9} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} - m_Threshold: 0.8095238 - m_Position: {x: 0, y: 0.9} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} - m_Threshold: 0.8857143 - m_Position: {x: 0.9, y: 0.9} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 m_BlendParameter: yaw m_BlendParameterY: forwardVelocity m_MinThreshold: 0.2 - m_MaxThreshold: 0.8857143 + m_MaxThreshold: 0.78775513 m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 @@ -494,7 +470,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 5237996256603445452} - m_Threshold: 0 + m_Threshold: 0.4 m_Position: {x: 0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -502,7 +478,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: -6390963665721911578} - m_Threshold: 0.2 + m_Threshold: 1 m_Position: {x: 1, y: 0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -511,7 +487,7 @@ BlendTree: m_BlendParameter: pitch m_BlendParameterY: pitch m_MinThreshold: -0.2 - m_MaxThreshold: 0.2 + m_MaxThreshold: 1 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index ef74099..65407dc 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -141,9 +141,9 @@ void Spawn() Vector3 ChooseLocation(WayPoint go) { Vector3 dimensions = new Vector3(SizeX / 2f, maxHeight - minHeight, SizeZ / 2f); - Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); + Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(0, 1f), Random.Range(-1f, 1f)); Vector3 pos = Vector3.Scale(dimensions, randNormalizedVector) + transform.position; - pos.y += minHeight; + pos.y += minHeight - transform.position.y; pos = GetHeightAdjusted(pos, go); diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 33cd909..ca5ab93 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -26,11 +26,6 @@ public class FlyingSteeringRig : MonoBehaviour [SerializeField, Tooltip("The maximum forward velocity for this body.")] internal float maxSpeed = 8; [SerializeField, Tooltip("How sensitive the body is to obstacles. Lower numbers mean the body will move closer to obstacles. Set this high enough that the model does not clip objects, the larger the model the higher this value needs to be.")] - [Range(0.1f, 6f)] - float m_AvoidanceSensitivity = 1f; - [SerializeField, Tooltip("The maximum distance that can be steered from the target direction. Setting this higher will allow the body to go more away from a direct line to the target.")] - [Range(1f, 5f)] - float m_MaxAvoidanceLength = 2f; [SerializeField, Tooltip("The body will attempt to avoid colliders on these layers.")] LayerMask m_AvoidanceLayers; @@ -79,12 +74,12 @@ private void Awake() private void ConfigureSensors() { List sensors = new List(); - sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 0.5f, m_AvoidanceLayers)); // forward - sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/left - sensors.Add(new Sensor(transform.forward - transform.right, 0.5f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/left + sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, m_AvoidanceLayers)); // forward + sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1.5f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/left + sensors.Add(new Sensor(transform.forward - transform.right, 1f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/left sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/left/left - sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/right - sensors.Add(new Sensor(transform.forward + transform.right, 0.5f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right + sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1.5f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/right + sensors.Add(new Sensor(transform.forward + transform.right, 1f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right sensors.Add(new Sensor(transform.forward + transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/right/right sensors.Add(new Sensor(-transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // left @@ -95,9 +90,9 @@ private void ConfigureSensors() sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/left sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/right - sensors.Add(new Sensor(-transform.up, 0, m_MinHeight, m_AvoidanceLayers)); // down + sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.2f, 0.5f, m_AvoidanceLayers)); // down sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/left - sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, m_AvoidanceLayers)); // down/forward + //sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, m_AvoidanceLayers)); // down/forward sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/right sensorArray = sensors.ToArray(); } @@ -137,57 +132,6 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } } - - /// - /// Get an angle around the x axis that will push the object back to the optimal height if - /// not already there. The angle will be the maximum - /// allowable vertical climb or dive angle proportional to the required - /// height change. However, if the current waypoint requires requires a different height from - /// the optimal height then this will return 0. - /// - float GetHeightAdjustmentAngle() - { - if (!m_MaintainHeight) return 0; - - RaycastHit hit; - float height = 0; - if (Physics.Raycast(rigidbody.transform.position, Vector3.down, out hit, Mathf.Infinity)) - { - height = hit.distance; - } - else - { - Debug.LogWarning($"{name} has `Maintain Height` enabled but therre is no raycast hit below it. Relying on Steering Behaviours to keep things in order."); - return 0; - } - - float angle = 0; - if (height < m_OptimalHeight) - { - if (height < m_MinHeight) - { - angle = Mathf.Lerp(0, m_MaxClimbAngle, Mathf.Clamp01((m_MinHeight - height) / m_MinHeight)); - } - else - { - angle = Mathf.Lerp(0, m_MaxClimbAngle, Mathf.Clamp01((m_OptimalHeight - height) / m_OptimalHeight)); - } - } else if (height > m_OptimalHeight) - { - if (destination.position.y > m_OptimalHeight) return 0; - - if (height > m_MaxHeight) { - //do angle dot thingy here - angle = Mathf.Lerp(-m_MaxDiveAngle, 0, Mathf.Clamp01((height - m_MaxHeight) / m_MaxHeight)); - } - else - { - angle = Mathf.Lerp(-m_MaxDiveAngle, 0, Mathf.Clamp01((height - m_OptimalHeight) / m_OptimalHeight)); - } - } - - return angle; - } private bool hasReachedDestination { get @@ -224,9 +168,6 @@ protected virtual void FixedUpdate() moveDirection += repulsion * 100; } - Quaternion heightRotation = Quaternion.Euler(GetHeightAdjustmentAngle(), 0, 0); - moveDirection = heightRotation * moveDirection; - // Rotate towards the desired direction float angle; Vector3 axis; @@ -236,7 +177,6 @@ protected virtual void FixedUpdate() var torque = Mathf.Clamp(angle / 20f, -1f, 1f) * m_MaxTorque; rigidbody.AddTorque(axis * torque); - // Keep the bottom facing down float z = rigidbody.rotation.eulerAngles.z; if (z > 180f) z -= 360f; @@ -372,6 +312,10 @@ class Sensor public float radius { get; set; } public float maxLength { get; set; } + public float avoidanceSensitivity = 0.6f; + + public float maxAvoidanceLength = 1.2f; + private LayerMask avoidanceLayers; public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoidanceLayers) { @@ -381,6 +325,16 @@ public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoida this.avoidanceLayers = avoidanceLayers; } + public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceSensitivity, float maxAvoidanceLength, LayerMask avoidanceLayers) + { + this.sensorDirection = direction; + this.radius = radius; + this.maxLength = maxLength; + this.avoidanceSensitivity = avoidanceSensitivity; + this.maxAvoidanceLength = maxAvoidanceLength; + this.avoidanceLayers = avoidanceLayers; + } + /// /// Check for obstructions in the sensor. Once pulsed the value of `hit` /// will be the `RaycastHit` returned by the testing raycast. From 50558e178eaf36c573c08eb27fdcd75574a27aef Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 29 Jan 2022 20:03:21 -0800 Subject: [PATCH 03/36] Remove over-zealous removal of avoidance length, this should be global for all sensors. --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index ca5ab93..7ad22f4 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -25,7 +25,6 @@ public class FlyingSteeringRig : MonoBehaviour float m_MaxForwardForce = 10; [SerializeField, Tooltip("The maximum forward velocity for this body.")] internal float maxSpeed = 8; - [SerializeField, Tooltip("How sensitive the body is to obstacles. Lower numbers mean the body will move closer to obstacles. Set this high enough that the model does not clip objects, the larger the model the higher this value needs to be.")] [SerializeField, Tooltip("The body will attempt to avoid colliders on these layers.")] LayerMask m_AvoidanceLayers; From 7dc256f84de85d0245ed68215fef76c6efc4b700 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 29 Jan 2022 23:23:10 -0800 Subject: [PATCH 04/36] Only update the sensors on a round robin for perf reasons... no noticable difference in the flight for around 17ms (>1 FPS) --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 7ad22f4..507e986 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -25,6 +25,9 @@ public class FlyingSteeringRig : MonoBehaviour float m_MaxForwardForce = 10; [SerializeField, Tooltip("The maximum forward velocity for this body.")] internal float maxSpeed = 8; + [SerializeField, Tooltip("The maximum distance that can be steered from the target direction. Setting this higher will allow the body to go more away from a direct line to the target.")] + [Range(1f, 5f)] + float m_MaxAvoidanceLength = 2f; [SerializeField, Tooltip("The body will attempt to avoid colliders on these layers.")] LayerMask m_AvoidanceLayers; @@ -59,6 +62,7 @@ public class FlyingSteeringRig : MonoBehaviour private float originalAnimationSpeed; private static Mesh cylinderCache; private Sensor[] sensorArray; + int nextSensorToPulse = 0; /// /// The transform of the current destination the object is flying to. @@ -89,7 +93,7 @@ private void ConfigureSensors() sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/left sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/right - sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.2f, 0.5f, m_AvoidanceLayers)); // down + sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.1f, m_AvoidanceLayers)); // down sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/left //sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, m_AvoidanceLayers)); // down/forward sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/right @@ -99,31 +103,20 @@ private void ConfigureSensors() /// /// Get a direction that will push the object away from detected obstacles. /// - Vector3 GetCalculateRepulsionDirection() + Vector3 GetRepulsionDirection() { - Vector3 strength = Vector3.zero; + sensorArray[nextSensorToPulse].Pulse(this); + nextSensorToPulse++; + if (nextSensorToPulse == sensorArray.Length) nextSensorToPulse = 0; + Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { - strength += CheckRepulsionFrom(sensorArray[i]); + strength += sensorArray[i].lastObstructionRatio; } return strength * Mathf.Clamp(strength.magnitude, 0, m_MaxAvoidanceLength); } - - private Vector3 CheckRepulsionFrom(Sensor sensor) - { - //OPTIMIZATION: don't pulse every frame - if (sensor.Pulse(this)) - { - float obstructionRatio = Mathf.Pow(1f - (sensor.hit.distance / sensor.maxLength), 1f / m_AvoidanceSensitivity); - return obstructionRatio * sensor.hit.normal; - } - else - { - return Vector3.zero; - } - } private void Start() { if (m_Animator) @@ -158,7 +151,7 @@ protected virtual void FixedUpdate() moveDirection += desiredDirection; } - Vector3 repulsion = GetCalculateRepulsionDirection(); + Vector3 repulsion = GetRepulsionDirection(); if (repulsion.sqrMagnitude > 0.01f) { moveDirection += repulsion.normalized; @@ -313,9 +306,22 @@ class Sensor public float avoidanceSensitivity = 0.6f; - public float maxAvoidanceLength = 1.2f; - private LayerMask avoidanceLayers; + internal Vector3 lastObstructionRatio + { + get + { + if (obstructionHit) + { + float obstructionRatio = Mathf.Pow(1f - (hit.distance / maxLength), 1f / avoidanceSensitivity); + return obstructionRatio * hit.normal; + } + else + { + return Vector3.zero; + } + } + } public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoidanceLayers) { this.sensorDirection = direction; @@ -324,13 +330,12 @@ public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoida this.avoidanceLayers = avoidanceLayers; } - public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceSensitivity, float maxAvoidanceLength, LayerMask avoidanceLayers) + public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceSensitivity, LayerMask avoidanceLayers) { this.sensorDirection = direction; this.radius = radius; this.maxLength = maxLength; this.avoidanceSensitivity = avoidanceSensitivity; - this.maxAvoidanceLength = maxAvoidanceLength; this.avoidanceLayers = avoidanceLayers; } From 386fdfe63f523e113252dcaf6d6bc2db2eba50ce Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 29 Jan 2022 23:23:27 -0800 Subject: [PATCH 05/36] Improved debug message --- Scripts/Runtime/BoxAreaSpawner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index 65407dc..c901588 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -190,7 +190,7 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) } else { - Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below it. Relying on the initial spawn positions height."); + Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); } } From df6469da49ca83e14a9df95b9ecc4496b0b6f945 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sun, 30 Jan 2022 00:11:10 -0800 Subject: [PATCH 06/36] Add some smoothing to direction changes --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 507e986..d145446 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -160,6 +160,10 @@ protected virtual void FixedUpdate() moveDirection += repulsion * 100; } + + Vector3 currentDirection = rigidbody.transform.forward; + Vector3.Lerp(currentDirection, moveDirection, Time.deltaTime * 4); + // Rotate towards the desired direction float angle; Vector3 axis; @@ -186,9 +190,6 @@ protected virtual void FixedUpdate() float verticalForce = 0; if (verticalDotMove > 0) { verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); - } else - { - verticalForce = Mathf.Lerp(0, -m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); } // Add the forces From 07bd6111a44ea4ad22c8e26c174a6463fde2202f Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sun, 30 Jan 2022 11:07:11 -0800 Subject: [PATCH 07/36] Remove time based smooting, didn't work well. Use avoidance strength on sensors instead --- Scripts/Runtime/MoveToWaypoint.cs | 1 - Scripts/Runtime/Steering/FlyingSteeringRig.cs | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index c82e67a..3b047e1 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -1,6 +1,5 @@ using UnityEngine; using SensorToolkit; -using UnityEngine.Serialization; #if PHOTOSESSION_PRESENT using Rowlan.PhotoSession; #endif diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index d145446..91d78d3 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -94,9 +94,9 @@ private void ConfigureSensors() sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/right sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.1f, m_AvoidanceLayers)); // down - sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/left - //sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, m_AvoidanceLayers)); // down/forward - sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight, m_AvoidanceLayers)); // down/right + sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/left + sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/right sensorArray = sensors.ToArray(); } @@ -160,10 +160,6 @@ protected virtual void FixedUpdate() moveDirection += repulsion * 100; } - - Vector3 currentDirection = rigidbody.transform.forward; - Vector3.Lerp(currentDirection, moveDirection, Time.deltaTime * 4); - // Rotate towards the desired direction float angle; Vector3 axis; From 6fbaf41b1d461640351f0cebdd0707e5d2767b47 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sun, 30 Jan 2022 23:26:25 -0800 Subject: [PATCH 08/36] Take off works, not landing yet. Replace waypoints code, thus allowing Sensor Toolkit to be removed as a dependency --- Animations/DragonController.controller | 639 ++++++++++++++++-- .../Placeholders/Grounded - Idle 1.anim | 53 ++ .../Placeholders/Grounded - Idle 1.anim.meta | 8 + .../Placeholders/Grounded - Idle 2.anim | 53 ++ .../Placeholders/Grounded - Idle 2.anim.meta | 8 + .../Placeholders/Grounded - Idle 3.anim | 53 ++ .../Placeholders/Grounded - Idle 3.anim.meta | 8 + Animations/Placeholders/Jump Forward.anim | 53 ++ .../Placeholders/Jump Forward.anim.meta | 8 + Animations/Placeholders/Jump Run.anim | 53 ++ Animations/Placeholders/Jump Run.anim.meta | 8 + Animations/Placeholders/Jump Up.anim | 53 ++ Animations/Placeholders/Jump Up.anim.meta | 8 + Animations/Placeholders/UpFly Backwards.anim | 53 ++ .../Placeholders/UpFly Backwards.anim.meta | 8 + .../Placeholders/UpFly Down Forward L.anim | 53 ++ .../UpFly Down Forward L.anim.meta | 8 + .../Placeholders/UpFly Down Forward R.anim | 53 ++ .../UpFly Down Forward R.anim.meta | 8 + Animations/Placeholders/UpFly Down.anim | 53 ++ Animations/Placeholders/UpFly Down.anim.meta | 8 + Animations/Placeholders/UpFly L.anim | 53 ++ Animations/Placeholders/UpFly L.anim.meta | 8 + Animations/Placeholders/UpFly R.anim | 53 ++ Animations/Placeholders/UpFly R.anim.meta | 8 + Animations/Placeholders/UpFly Stand.anim | 53 ++ Animations/Placeholders/UpFly Stand.anim.meta | 8 + Animations/Placeholders/UpFly Strafe L.anim | 53 ++ .../Placeholders/UpFly Strafe L.anim.meta | 8 + Animations/Placeholders/UpFly Strafe R.anim | 53 ++ .../Placeholders/UpFly Strafe R.anim.meta | 8 + Animations/Placeholders/UpFly Up Turn L.anim | 53 ++ .../Placeholders/UpFly Up Turn L.anim.meta | 8 + Animations/Placeholders/UpFly Up Turn R.anim | 53 ++ .../Placeholders/UpFly Up Turn R.anim.meta | 8 + Animations/Placeholders/UpFly Up.anim | 53 ++ Animations/Placeholders/UpFly Up.anim.meta | 8 + Animations/Placeholders/UpFly.anim | 53 ++ Animations/Placeholders/UpFly.anim.meta | 8 + Animations/Placeholders/UpGlide L.anim | 53 ++ Animations/Placeholders/UpGlide L.anim.meta | 8 + Animations/Placeholders/UpGlide R.anim | 53 ++ Animations/Placeholders/UpGlide R.anim.meta | 8 + Animations/Placeholders/UpGlide.anim | 53 ++ Animations/Placeholders/UpGlide.anim.meta | 8 + Animations/Placeholders/Walk Forward.anim | 53 ++ .../Placeholders/Walk Forward.anim.meta | 8 + Animations/Unka.overrideController | 23 +- Documentation/flyCam.md | 16 +- Prefabs/Large Creature Waypoint.prefab | 4 +- Prefabs/Large Creature Waypoint.prefab.meta | 5 +- Prefabs/Waypoint Spawner.prefab | 14 +- Prefabs/Waypoint.prefab | 6 +- README.md | 9 - .../wizardscode.ai.explorer.editor.asmdef | 6 +- Scripts/Runtime/Animation.meta | 8 + Scripts/Runtime/BoxAreaSpawner.cs | 146 ++-- Scripts/Runtime/MoveToWaypoint.cs | 223 ++++-- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 149 +++- Scripts/Runtime/WayPoint.cs | 9 +- .../Runtime/wizardscode.ai.explorer.asmdef | 6 +- 61 files changed, 2383 insertions(+), 283 deletions(-) create mode 100644 Animations/Placeholders/Grounded - Idle 1.anim create mode 100644 Animations/Placeholders/Grounded - Idle 1.anim.meta create mode 100644 Animations/Placeholders/Grounded - Idle 2.anim create mode 100644 Animations/Placeholders/Grounded - Idle 2.anim.meta create mode 100644 Animations/Placeholders/Grounded - Idle 3.anim create mode 100644 Animations/Placeholders/Grounded - Idle 3.anim.meta create mode 100644 Animations/Placeholders/Jump Forward.anim create mode 100644 Animations/Placeholders/Jump Forward.anim.meta create mode 100644 Animations/Placeholders/Jump Run.anim create mode 100644 Animations/Placeholders/Jump Run.anim.meta create mode 100644 Animations/Placeholders/Jump Up.anim create mode 100644 Animations/Placeholders/Jump Up.anim.meta create mode 100644 Animations/Placeholders/UpFly Backwards.anim create mode 100644 Animations/Placeholders/UpFly Backwards.anim.meta create mode 100644 Animations/Placeholders/UpFly Down Forward L.anim create mode 100644 Animations/Placeholders/UpFly Down Forward L.anim.meta create mode 100644 Animations/Placeholders/UpFly Down Forward R.anim create mode 100644 Animations/Placeholders/UpFly Down Forward R.anim.meta create mode 100644 Animations/Placeholders/UpFly Down.anim create mode 100644 Animations/Placeholders/UpFly Down.anim.meta create mode 100644 Animations/Placeholders/UpFly L.anim create mode 100644 Animations/Placeholders/UpFly L.anim.meta create mode 100644 Animations/Placeholders/UpFly R.anim create mode 100644 Animations/Placeholders/UpFly R.anim.meta create mode 100644 Animations/Placeholders/UpFly Stand.anim create mode 100644 Animations/Placeholders/UpFly Stand.anim.meta create mode 100644 Animations/Placeholders/UpFly Strafe L.anim create mode 100644 Animations/Placeholders/UpFly Strafe L.anim.meta create mode 100644 Animations/Placeholders/UpFly Strafe R.anim create mode 100644 Animations/Placeholders/UpFly Strafe R.anim.meta create mode 100644 Animations/Placeholders/UpFly Up Turn L.anim create mode 100644 Animations/Placeholders/UpFly Up Turn L.anim.meta create mode 100644 Animations/Placeholders/UpFly Up Turn R.anim create mode 100644 Animations/Placeholders/UpFly Up Turn R.anim.meta create mode 100644 Animations/Placeholders/UpFly Up.anim create mode 100644 Animations/Placeholders/UpFly Up.anim.meta create mode 100644 Animations/Placeholders/UpFly.anim create mode 100644 Animations/Placeholders/UpFly.anim.meta create mode 100644 Animations/Placeholders/UpGlide L.anim create mode 100644 Animations/Placeholders/UpGlide L.anim.meta create mode 100644 Animations/Placeholders/UpGlide R.anim create mode 100644 Animations/Placeholders/UpGlide R.anim.meta create mode 100644 Animations/Placeholders/UpGlide.anim create mode 100644 Animations/Placeholders/UpGlide.anim.meta create mode 100644 Animations/Placeholders/Walk Forward.anim create mode 100644 Animations/Placeholders/Walk Forward.anim.meta create mode 100644 Scripts/Runtime/Animation.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 6ce4939..b253672 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -11,7 +11,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} m_Threshold: 13 - m_Position: {x: -0.5, y: -0.2} + m_Position: {x: -0.5, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -19,7 +19,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} m_Threshold: 18 - m_Position: {x: 0, y: -0.2} + m_Position: {x: 0, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -27,7 +27,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_Threshold: 23 - m_Position: {x: 0.5, y: -0.2} + m_Position: {x: 0.5, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -35,7 +35,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} m_Threshold: 28 - m_Position: {x: -0.7, y: -0.8} + m_Position: {x: -0.7, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -43,7 +43,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} m_Threshold: 33 - m_Position: {x: 0, y: -0.8} + m_Position: {x: 0, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -51,18 +51,43 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} m_Threshold: 38 - m_Position: {x: 0.7, y: -0.8} + m_Position: {x: 0.7, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: yaw - m_BlendParameterY: verticalVelocity + m_BlendParameter: angularVelocity + m_BlendParameterY: forwardVelocity m_MinThreshold: 13 m_MaxThreshold: 38 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1101 &-6849355106312461386 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: verticalVelocity + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1385069710956288641} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.90625 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!206 &-6390963665721911578 BlendTree: m_ObjectHideFlags: 1 @@ -83,7 +108,7 @@ BlendTree: m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Threshold: 18 m_Position: {x: 0, y: 0} - m_TimeScale: 1.4 + m_TimeScale: 1.5 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 @@ -98,7 +123,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} m_Threshold: 26 - m_Position: {x: -0.7, y: 0.7} + m_Position: {x: -0.7, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -106,7 +131,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} m_Threshold: 30 - m_Position: {x: 0, y: 0.8} + m_Position: {x: 0, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -114,24 +139,94 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_Threshold: 34 - m_Position: {x: 0.7, y: 0.7} + m_Position: {x: 0.7, y: 1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: yaw - m_BlendParameterY: pitch + m_BlendParameter: angularVelocity + m_BlendParameterY: forwardVelocity m_MinThreshold: 14 m_MaxThreshold: 34 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +<<<<<<< Updated upstream +--- !u!206 &-5110191505608462634 +BlendTree: +======= +--- !u!1109 &-6249805993816533927 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7658257134381773050} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 --- !u!1101 &-5621913499797024570 AnimatorStateTransition: +>>>>>>> Stashed changes m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} +<<<<<<< Updated upstream + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 87905e8efc51e9848a1d33a36aa95157, type: 2} + m_Threshold: 0 + m_Position: {x: -1, y: 3} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: X + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 14bbf774c9a3ed949b3f10dd1f5037e7, type: 2} + m_Threshold: 0.25 + m_Position: {x: -0, y: 6} + m_TimeScale: 1.2 + m_CycleOffset: 0 + m_DirectBlendParameter: X + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + m_Threshold: 0.5 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: X + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: d99d545b590dd754db3eaf4891ad104b, type: 2} + m_Threshold: 0.75 + m_Position: {x: 1, y: 3} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: X + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 18aa6846075b13e43b13bc3b3307791e, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: -4} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: X + m_Mirror: 0 + m_BlendParameter: angularVelocity + m_BlendParameterY: forwardVelocity + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 1 +======= m_Name: m_Conditions: - m_ConditionMode: 1 @@ -151,6 +246,95 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 +--- !u!1102 &-2862842708842554754 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Land + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 897241709742554265} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7518922156995010553} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-2549987733969162959 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7929321913217887456} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.45 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!206 &-2355690225596318970 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} + m_Threshold: 0.33 + m_Position: {x: 0, y: 0.4} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: forwardVelocity + m_BlendParameterY: forwardVelocity + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +>>>>>>> Stashed changes --- !u!1107 &-2323046387310864844 AnimatorStateMachine: serializedVersion: 6 @@ -161,24 +345,42 @@ AnimatorStateMachine: m_Name: Base Layer m_ChildStates: - serializedVersion: 1 +<<<<<<< Updated upstream + m_State: {fileID: 7320282026098016608} + m_Position: {x: 480, y: -220, z: 0} + - serializedVersion: 1 + m_State: {fileID: 7929321913217887456} + m_Position: {x: 480, y: 110, z: 0} +======= m_State: {fileID: 7929321913217887456} - m_Position: {x: 470, y: 110, z: 0} + m_Position: {x: 550, y: 110, z: 0} - serializedVersion: 1 m_State: {fileID: 3062000143290070295} - m_Position: {x: 470, y: 270, z: 0} + m_Position: {x: 830, y: 110, z: 0} - serializedVersion: 1 - m_State: {fileID: -1651374198255606467} - m_Position: {x: 532.09485, y: -64.83923, z: 0} + m_State: {fileID: 1385069710956288641} + m_Position: {x: 550, y: -70, z: 0} + - serializedVersion: 1 + m_State: {fileID: 7658257134381773050} + m_Position: {x: 270, y: 110, z: 0} + - serializedVersion: 1 + m_State: {fileID: -2862842708842554754} + m_Position: {x: 540, y: 280, z: 0} +>>>>>>> Stashed changes m_ChildStateMachines: [] m_AnyStateTransitions: [] - m_EntryTransitions: [] + m_EntryTransitions: + - {fileID: -6249805993816533927} m_StateMachineTransitions: {} m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_AnyStatePosition: {x: 1070, y: 280, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0} - m_ExitPosition: {x: 800, y: 120, z: 0} + m_ExitPosition: {x: 1130, y: 100, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} +<<<<<<< Updated upstream m_DefaultState: {fileID: 7929321913217887456} +======= + m_DefaultState: {fileID: 7658257134381773050} --- !u!1101 &-2227351312352247077 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -204,32 +406,7 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1102 &-1651374198255606467 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Fly Hover - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: [] - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: +>>>>>>> Stashed changes --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 @@ -239,6 +416,27 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: +<<<<<<< Updated upstream + - m_Name: angularVelocity +======= + - m_Name: isGrounded + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 1 + m_Controller: {fileID: 9100000} + - m_Name: land + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: glide + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 @@ -252,6 +450,7 @@ AnimatorController: m_DefaultBool: 0 m_Controller: {fileID: 9100000} - m_Name: yaw +>>>>>>> Stashed changes m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 @@ -269,12 +468,6 @@ AnimatorController: m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 9100000} - - m_Name: glide - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 0 - m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -288,6 +481,74 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} +<<<<<<< Updated upstream +======= +--- !u!1109 &229971009591500439 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 +--- !u!1101 &897241709742554265 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7658257134381773050} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.6666666 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &1385069710956288641 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Take Off + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 7853129839041897887} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: -2355690225596318970} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!206 &2091492798866408738 BlendTree: m_ObjectHideFlags: 1 @@ -327,6 +588,31 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 +--- !u!1101 &2751168201624032978 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: land + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -2862842708842554754} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1102 &3062000143290070295 AnimatorState: serializedVersion: 6 @@ -354,6 +640,60 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1101 &3965547454830397286 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7929321913217887456} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1109 &4255577577117572388 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: -2323046387310864844} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 +--- !u!1109 &4743579291339850867 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: -2323046387310864844} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 +>>>>>>> Stashed changes --- !u!206 &5237996256603445452 BlendTree: m_ObjectHideFlags: 1 @@ -365,38 +705,38 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 0.2 - m_Position: {x: -0.6, y: 0.4} + m_Position: {x: -0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} - m_Threshold: 0.2979592 - m_Position: {x: 0, y: 0.5} - m_TimeScale: 1 + m_Threshold: 0.2888889 + m_Position: {x: 0, y: 0.85} + m_TimeScale: 1.2 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} - m_Threshold: 0.39591837 - m_Position: {x: 0.6, y: 0.4} + m_Threshold: 0.37777779 + m_Position: {x: 0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} - m_Threshold: 0.4938776 - m_Position: {x: -0.4, y: 0} + m_Threshold: 0.4666667 + m_Position: {x: -0.6, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Threshold: 0.59183675 + m_Threshold: 0.5555556 m_Position: {x: 0, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -404,27 +744,171 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} - m_Threshold: 0.689796 - m_Position: {x: 0.4, y: 0} + m_Threshold: 0.64444447 + m_Position: {x: 0.6, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 158e99599478daf43ae8974ce40e44d2, type: 2} - m_Threshold: 0.78775513 + m_Threshold: 0.73333335 m_Position: {x: 0, y: -1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: yaw + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} + m_Threshold: 0.82222223 + m_Position: {x: -1, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} + m_Threshold: 0.9111111 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} + m_Threshold: 1 + m_Position: {x: 1, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + m_BlendParameter: angularVelocity m_BlendParameterY: forwardVelocity m_MinThreshold: 0.2 - m_MaxThreshold: 0.78775513 + m_MaxThreshold: 1 m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 +<<<<<<< Updated upstream +--- !u!1102 &7320282026098016608 +======= +--- !u!1101 &7113365851612787807 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7929321913217887456} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.45 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!206 &7518922156995010553 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} + m_Threshold: 0.25 + m_Position: {x: 0, y: 0.4} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: forwardVelocity + m_BlendParameterY: forwardVelocity + m_MinThreshold: 0.25 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!1102 &7658257134381773050 +>>>>>>> Stashed changes +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} +<<<<<<< Updated upstream + m_Name: Fly Level + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] +======= + m_Name: Grounded - Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -6849355106312461386} +>>>>>>> Stashed changes + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 +<<<<<<< Updated upstream + m_Motion: {fileID: -5110191505608462634} +======= + m_Motion: {fileID: 7400000, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} +>>>>>>> Stashed changes + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +<<<<<<< Updated upstream +======= +--- !u!1101 &7853129839041897887 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7929321913217887456} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.45 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +>>>>>>> Stashed changes --- !u!1102 &7929321913217887456 AnimatorState: serializedVersion: 6 @@ -435,8 +919,13 @@ AnimatorState: m_Name: Flight m_Speed: 1 m_CycleOffset: 0 +<<<<<<< Updated upstream + m_Transitions: [] +======= m_Transitions: - {fileID: -5621913499797024570} + - {fileID: 2751168201624032978} +>>>>>>> Stashed changes m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -462,7 +951,7 @@ BlendTree: m_Childs: - serializedVersion: 2 m_Motion: {fileID: -8904977728813876417} - m_Threshold: -0.2 + m_Threshold: -0.7 m_Position: {x: -1, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -470,24 +959,24 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 5237996256603445452} - m_Threshold: 0.4 - m_Position: {x: 0.2, y: 0} + m_Threshold: 0 + m_Position: {x: 3, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: -6390963665721911578} - m_Threshold: 1 + m_Threshold: 0.8 m_Position: {x: 1, y: 0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: pitch - m_BlendParameterY: pitch - m_MinThreshold: -0.2 - m_MaxThreshold: 1 + m_BlendParameter: verticalVelocity + m_BlendParameterY: verticalVelocity + m_MinThreshold: -0.7 + m_MaxThreshold: 0.8 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 diff --git a/Animations/Placeholders/Grounded - Idle 1.anim b/Animations/Placeholders/Grounded - Idle 1.anim new file mode 100644 index 0000000..98fed0b --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 1.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grounded - Idle 1 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 1.anim.meta b/Animations/Placeholders/Grounded - Idle 1.anim.meta new file mode 100644 index 0000000..2fedab8 --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 1.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4831672f16dfe744d9678abaa1fb34d5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Grounded - Idle 2.anim b/Animations/Placeholders/Grounded - Idle 2.anim new file mode 100644 index 0000000..b601f0d --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 2.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grounded - Idle 2 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 2.anim.meta b/Animations/Placeholders/Grounded - Idle 2.anim.meta new file mode 100644 index 0000000..33c95b3 --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 2.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51cb2bd50c3f1374bbe8b099d7fb522c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Grounded - Idle 3.anim b/Animations/Placeholders/Grounded - Idle 3.anim new file mode 100644 index 0000000..4773919 --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 3.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grounded - Idle 3 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 3.anim.meta b/Animations/Placeholders/Grounded - Idle 3.anim.meta new file mode 100644 index 0000000..34b1c43 --- /dev/null +++ b/Animations/Placeholders/Grounded - Idle 3.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a91187913900d84ba38e9153afaebd7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Jump Forward.anim b/Animations/Placeholders/Jump Forward.anim new file mode 100644 index 0000000..bb6e420 --- /dev/null +++ b/Animations/Placeholders/Jump Forward.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Jump Forward + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Jump Forward.anim.meta b/Animations/Placeholders/Jump Forward.anim.meta new file mode 100644 index 0000000..c2def89 --- /dev/null +++ b/Animations/Placeholders/Jump Forward.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d2e2cdc6cc0c04b40827eb81f9d8409a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Jump Run.anim b/Animations/Placeholders/Jump Run.anim new file mode 100644 index 0000000..4086218 --- /dev/null +++ b/Animations/Placeholders/Jump Run.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Jump Run + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Jump Run.anim.meta b/Animations/Placeholders/Jump Run.anim.meta new file mode 100644 index 0000000..360c88b --- /dev/null +++ b/Animations/Placeholders/Jump Run.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70997ae4164ecb646949949ea2ece781 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Jump Up.anim b/Animations/Placeholders/Jump Up.anim new file mode 100644 index 0000000..df43f3a --- /dev/null +++ b/Animations/Placeholders/Jump Up.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Jump Up + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Jump Up.anim.meta b/Animations/Placeholders/Jump Up.anim.meta new file mode 100644 index 0000000..898de23 --- /dev/null +++ b/Animations/Placeholders/Jump Up.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc1a19ae29c61de40a0fae09acdb0251 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Backwards.anim b/Animations/Placeholders/UpFly Backwards.anim new file mode 100644 index 0000000..0ed349d --- /dev/null +++ b/Animations/Placeholders/UpFly Backwards.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Backwards + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Backwards.anim.meta b/Animations/Placeholders/UpFly Backwards.anim.meta new file mode 100644 index 0000000..6106787 --- /dev/null +++ b/Animations/Placeholders/UpFly Backwards.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 158e99599478daf43ae8974ce40e44d2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down Forward L.anim b/Animations/Placeholders/UpFly Down Forward L.anim new file mode 100644 index 0000000..c272ca7 --- /dev/null +++ b/Animations/Placeholders/UpFly Down Forward L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Down Forward L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward L.anim.meta b/Animations/Placeholders/UpFly Down Forward L.anim.meta new file mode 100644 index 0000000..cab0002 --- /dev/null +++ b/Animations/Placeholders/UpFly Down Forward L.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 865afa414143d9b4dbb47938baa15854 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down Forward R.anim b/Animations/Placeholders/UpFly Down Forward R.anim new file mode 100644 index 0000000..758818e --- /dev/null +++ b/Animations/Placeholders/UpFly Down Forward R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Down Forward R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward R.anim.meta b/Animations/Placeholders/UpFly Down Forward R.anim.meta new file mode 100644 index 0000000..ebeeceb --- /dev/null +++ b/Animations/Placeholders/UpFly Down Forward R.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b9df435da0377284ca1a151b641cf1d3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down.anim b/Animations/Placeholders/UpFly Down.anim new file mode 100644 index 0000000..770e2b7 --- /dev/null +++ b/Animations/Placeholders/UpFly Down.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Down + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Down.anim.meta b/Animations/Placeholders/UpFly Down.anim.meta new file mode 100644 index 0000000..f8e9f11 --- /dev/null +++ b/Animations/Placeholders/UpFly Down.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5cc910c66b70fb04284254469d04f532 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly L.anim b/Animations/Placeholders/UpFly L.anim new file mode 100644 index 0000000..bba9d4c --- /dev/null +++ b/Animations/Placeholders/UpFly L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly L.anim.meta b/Animations/Placeholders/UpFly L.anim.meta new file mode 100644 index 0000000..e40029e --- /dev/null +++ b/Animations/Placeholders/UpFly L.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc9cbc5b07c4f5d4ebee64760b87f7ab +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly R.anim b/Animations/Placeholders/UpFly R.anim new file mode 100644 index 0000000..1547ef6 --- /dev/null +++ b/Animations/Placeholders/UpFly R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly R.anim.meta b/Animations/Placeholders/UpFly R.anim.meta new file mode 100644 index 0000000..35df1ae --- /dev/null +++ b/Animations/Placeholders/UpFly R.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba3ade90af933bc4ea3f02fa11877300 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Stand.anim b/Animations/Placeholders/UpFly Stand.anim new file mode 100644 index 0000000..af8cb1c --- /dev/null +++ b/Animations/Placeholders/UpFly Stand.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Stand + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Stand.anim.meta b/Animations/Placeholders/UpFly Stand.anim.meta new file mode 100644 index 0000000..fdc3e40 --- /dev/null +++ b/Animations/Placeholders/UpFly Stand.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 716784733869f5f44855acc139951a66 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Strafe L.anim b/Animations/Placeholders/UpFly Strafe L.anim new file mode 100644 index 0000000..6c809c3 --- /dev/null +++ b/Animations/Placeholders/UpFly Strafe L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Strafe L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe L.anim.meta b/Animations/Placeholders/UpFly Strafe L.anim.meta new file mode 100644 index 0000000..d5f158f --- /dev/null +++ b/Animations/Placeholders/UpFly Strafe L.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b47b571577c971449a4f1f5d234b2fb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Strafe R.anim b/Animations/Placeholders/UpFly Strafe R.anim new file mode 100644 index 0000000..055656f --- /dev/null +++ b/Animations/Placeholders/UpFly Strafe R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Strafe R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe R.anim.meta b/Animations/Placeholders/UpFly Strafe R.anim.meta new file mode 100644 index 0000000..58519a4 --- /dev/null +++ b/Animations/Placeholders/UpFly Strafe R.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e26352eb41642447820642ab5e48ea5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up Turn L.anim b/Animations/Placeholders/UpFly Up Turn L.anim new file mode 100644 index 0000000..cf2958a --- /dev/null +++ b/Animations/Placeholders/UpFly Up Turn L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Up Turn L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn L.anim.meta b/Animations/Placeholders/UpFly Up Turn L.anim.meta new file mode 100644 index 0000000..c956e7c --- /dev/null +++ b/Animations/Placeholders/UpFly Up Turn L.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ee1aad5e0fb6404e83daaa12fe3b60c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up Turn R.anim b/Animations/Placeholders/UpFly Up Turn R.anim new file mode 100644 index 0000000..4f07ba9 --- /dev/null +++ b/Animations/Placeholders/UpFly Up Turn R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Up Turn R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn R.anim.meta b/Animations/Placeholders/UpFly Up Turn R.anim.meta new file mode 100644 index 0000000..8b496a1 --- /dev/null +++ b/Animations/Placeholders/UpFly Up Turn R.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f5f6ad99c462a594b9a74b5934303e29 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up.anim b/Animations/Placeholders/UpFly Up.anim new file mode 100644 index 0000000..da54396 --- /dev/null +++ b/Animations/Placeholders/UpFly Up.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly Up + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly Up.anim.meta b/Animations/Placeholders/UpFly Up.anim.meta new file mode 100644 index 0000000..dfa12ff --- /dev/null +++ b/Animations/Placeholders/UpFly Up.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8672a58cf3dba174fabfc1a6e917128b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpFly.anim b/Animations/Placeholders/UpFly.anim new file mode 100644 index 0000000..c52cb6f --- /dev/null +++ b/Animations/Placeholders/UpFly.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpFly + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpFly.anim.meta b/Animations/Placeholders/UpFly.anim.meta new file mode 100644 index 0000000..89c991a --- /dev/null +++ b/Animations/Placeholders/UpFly.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3bba46aa8991b143b164fe8f22f6d79 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide L.anim b/Animations/Placeholders/UpGlide L.anim new file mode 100644 index 0000000..c017347 --- /dev/null +++ b/Animations/Placeholders/UpGlide L.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpGlide L + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide L.anim.meta b/Animations/Placeholders/UpGlide L.anim.meta new file mode 100644 index 0000000..30600e7 --- /dev/null +++ b/Animations/Placeholders/UpGlide L.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: baa36b7c17a4288439f4e20dd5e8e798 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide R.anim b/Animations/Placeholders/UpGlide R.anim new file mode 100644 index 0000000..0120d00 --- /dev/null +++ b/Animations/Placeholders/UpGlide R.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpGlide R + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide R.anim.meta b/Animations/Placeholders/UpGlide R.anim.meta new file mode 100644 index 0000000..f6f41e0 --- /dev/null +++ b/Animations/Placeholders/UpGlide R.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c46f8b459a2e39489ad33e0c25e45e4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide.anim b/Animations/Placeholders/UpGlide.anim new file mode 100644 index 0000000..27e3ae8 --- /dev/null +++ b/Animations/Placeholders/UpGlide.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpGlide + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/UpGlide.anim.meta b/Animations/Placeholders/UpGlide.anim.meta new file mode 100644 index 0000000..09f6888 --- /dev/null +++ b/Animations/Placeholders/UpGlide.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8355f35815429be48b4719939f7c92ae +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Walk Forward.anim b/Animations/Placeholders/Walk Forward.anim new file mode 100644 index 0000000..895022d --- /dev/null +++ b/Animations/Placeholders/Walk Forward.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Walk Forward + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Walk Forward.anim.meta b/Animations/Placeholders/Walk Forward.anim.meta new file mode 100644 index 0000000..39c42e5 --- /dev/null +++ b/Animations/Placeholders/Walk Forward.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a59a6f188ee09e14d908a6c9e147efff +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Unka.overrideController b/Animations/Unka.overrideController index 9e1e570..d5efee2 100644 --- a/Animations/Unka.overrideController +++ b/Animations/Unka.overrideController @@ -29,6 +29,8 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} @@ -41,9 +43,18 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400048, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_OverrideClip: {fileID: 7400050, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: c9b532f2b2c55b0409a5822a7aeffeb6, type: 2} - m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 6ea14cca7893ae448b5f6ecdcea029ee, type: 2} - m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 705b9cfb18289ba4ca5016d9ac206754, type: 2} - m_OverrideClip: {fileID: 7400006, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} +<<<<<<< Updated upstream +======= + - m_OriginalClip: {fileID: 7400000, guid: 4831672f16dfe744d9678abaa1fb34d5, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 51cb2bd50c3f1374bbe8b099d7fb522c, type: 2} + m_OverrideClip: {fileID: 7400002, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 0a91187913900d84ba38e9153afaebd7, type: 2} + m_OverrideClip: {fileID: 7400004, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 70997ae4164ecb646949949ea2ece781, type: 2} + m_OverrideClip: {fileID: 7400004, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: bc1a19ae29c61de40a0fae09acdb0251, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: d2e2cdc6cc0c04b40827eb81f9d8409a, type: 2} + m_OverrideClip: {fileID: 7400008, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} +>>>>>>> Stashed changes diff --git a/Documentation/flyCam.md b/Documentation/flyCam.md index a7cff54..1f48727 100644 --- a/Documentation/flyCam.md +++ b/Documentation/flyCam.md @@ -18,10 +18,8 @@ This component manages the behaviour of the follow target. All parameters should The sensors section describes how the body senses waypoints that will define its flightpath: - * Waypoint Sensor - the [Sensor Tookit](https://bit.ly/SensorTookit) provided Waypoint Sensor, see below. - * Waypont Arrival Sensor - the [Sensor Tookit](https://bit.ly/SensorTookit) provided Waypoint Arrival Sensor, see below. * Waypoint Prefab - the waypoint prefab that sensors will be trying to detect - * Strategy - defines how the next candidate waypoints are selected. Note that waypoints can have a `Next Waypoint` defined. If it is defined it will take precedent over the list created by this strategy. Note also that the weight of candidate waypoints is used to make the final selection (see below), but the initial shortlist is created using this strategy. Strategies include `Furhest` (select the furthest detected waypoint), "Nearest" (select the nearest detected waypoint), "Random" select a random waypoint from the list detected. + * Strategy - defines how the next candidate waypoints are selected. Note that waypoints can have a `Next Waypoint` defined. If it is defined it will take precedent over the list created by this strategy. Note also that the weight of candidate waypoints is used to make the final selection (see below), but the initial shortlist is created using this strategy. Strategies include `Furthest` (select the furthest detected waypoint), "Nearest" (select the nearest detected waypoint), "Random" select a random waypoint from the list detected. * Randomness - this prevents the same path being taken every time. The lower this value the more mathematicaly certain the selection criteria is. A value of 0 will result in the same path each time, that is no randomness. @@ -38,10 +36,6 @@ The sensors section describes how the body senses waypoints that will define its ## Steering Rig (Child) -The `Camera Steering Rig` is an extension of their `Steering Rig` provided by [Sensor Toolkit](https://bit.ly/SensorTookit) which is required for this code to work. - -The critical parameters for this use case are described below, consult the Sensor Toolkit documentation for information on other parameters: - * Turn Force - (think "turning speed") the maximum torgque that can be applied to the rigid body, for most use cases a value between 0 and 1 seems to work well but you may get different results. * Move Force - (think "forward speed") The maximum forward force that can be applied to the rigid body. What this should be set to depends alot on the rigid bodies mass and drag. * Strafe Force - (think "horizontal/backward speed") the maximum sideways or backwards force that can be applied to the rigid body. What this should be set to depends alot on the rigid bodies mass and drag. @@ -68,18 +62,12 @@ If any of these paramaters are set to try you will be able to set the follwoing ### Height Management -If the `Maintain Height` property is set to true this section controls how height is managed for this body. Note that Height is also managed by the Sensor Toolkit sensor array. The difference is that this section manages a preferred height while the sensor array ensures the body does not hit an obstacle. +If the `Maintain Height` property is set to true this section controls how height is managed for this body. * Min Height - the minimum height that the body can normally fly at. If the sensor array has a sensor that defines a greater minimum height it will take precedence over this setting. * Max Height - The maximum height this body is normally allowed to fly at. * Optimal Height - the height that this body will prefer to fly at if possible. The body will tend towards this height unless there is an obstacle or waypoint that required it move to a different height. -## WaypointSensor (Child) - -The `Waypoint Sensor` is provided by [Sensor Toolkit](https://bit.ly/SensorTookit) which is required for this code to work. See the Sensor Toolkit for complete documentation here are some of the essential parameters for this use case: - - * `Sensor Range` the radius, in world units, within which waypoints will be detected. - # Follow CmM VCam1 This is a standard Cinemachine Virtual Camera. To use this camera your main camera will have had a `Cinemachine Brain` added. You can replace this with any Cinemachine camera you want. diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 978dc4d..378d38e 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -140,7 +140,7 @@ GameObject: - component: {fileID: 434040} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 31 + m_Layer: 0 m_Name: Large Creature Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -170,7 +170,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 diff --git a/Prefabs/Large Creature Waypoint.prefab.meta b/Prefabs/Large Creature Waypoint.prefab.meta index e22ccae..284389d 100644 --- a/Prefabs/Large Creature Waypoint.prefab.meta +++ b/Prefabs/Large Creature Waypoint.prefab.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 guid: 4461efe13fc67904f8db2e5c8591aed0 -timeCreated: 1504618869 -licenseType: Store -NativeFormatImporter: +PrefabImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Prefabs/Waypoint Spawner.prefab b/Prefabs/Waypoint Spawner.prefab index 64373bf..969c496 100644 --- a/Prefabs/Waypoint Spawner.prefab +++ b/Prefabs/Waypoint Spawner.prefab @@ -43,18 +43,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1db34d609036b994ca87258eca785453, type: 3} m_Name: m_EditorClassIdentifier: - ToSpawn: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - StartSpawnAmount: 2 - TotalNumber: 5 + ToSpawn: {fileID: 146072, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} + Number: 5 SpawnInterval: 5 + StartSpawnAmount: 2 SizeX: 100 + SizeY: 10 SizeZ: 100 - minHeight: 7 - maxHeight: 7 - AdjustToTerrainHeight: 1 - SpawnAboveWater: 1 + ClearRadius: 1.8 ObstructingLayers: serializedVersion: 2 m_Bits: 1 - m_ShowAvailable: 0 - m_ShowUnavailable: 0 diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index 9d02004..f5d8c69 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -141,7 +141,7 @@ GameObject: - component: {fileID: 5417428} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 31 + m_Layer: 0 m_Name: Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -187,7 +187,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 @@ -204,8 +204,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b1a3bf12463cfa542ae3f0b85a5baffc, type: 3} m_Name: m_EditorClassIdentifier: + ClearRadius: 1.8 weight: 0.5 reEnableWaitTime: 0 + NextWaypoint: {fileID: 0} --- !u!1 &173338 GameObject: m_ObjectHideFlags: 0 diff --git a/README.md b/README.md index 3a70b27..fc77fda 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ This is an Automated Explorer that will explore your scene for you. You can see Note, although the implementation can be made to work in internal spaces it has not been tested and we expect challenges in many such scenes. There is no pathfinding, only sensor movement, and so the current implementation is unable to identify an optimal path. However, it should be possible to use an algorithm such as A* to pathfind and then place waypoints along this path. In this situation the sensor navigation would then avoid obstacles in 3D space along the path. We would love a PR to implement this. -IMPORTANT: this code is dependent on the excellent [Sensor Toolkit](https://assetstore.unity.com/packages/tools/ai/sensor-toolkit-88036?aid=1101l866w) asset. It's cheap and excellent, we don't believe in reinventing the wheel, though we will accept PRs that remove this dependency. If you don't already have it please use the link above as it is our affiliate link, buy yourself an asset, buy us coffee. It also uses Cinemachine, but this is a free package from Unity so no worries there. - ## Features * Camera navigates in 3D space between waypoints @@ -20,12 +18,6 @@ IMPORTANT: this code is dependent on the excellent [Sensor Toolkit](https://asse This is the easiest way of installing the code. Start with a standard Unity project and then follow the steps below. Note, using this method you cannot edit the sourcecode as packages are imported in read only mode. If you want to work with the code use the method described in the next section. -### Install Sensor Toolkit - - 1. Purchase and Install [Sensor Toolkit](https://assetstore.unity.com/packages/tools/ai/sensor-toolkit-88036?aid=1101l866w) (affiliate link) - 2. Note this code requires that the `SteeringRig.FixedUpdate` method in SensorToolkit is marked `protected virtual` which it is not out of the box. We've made a request to do this at https://forum.unity.com/threads/released-sensor-toolkit.468255/#post-7832232 but at the time of writing you will need to make this edit yourself. - 3. Add an Assembly Definition file called `Assets/SensorToolkit/micosmo.sensortoolkit` - the default file created will be enough, but note that more nuance will be needed if you plan to make a build. PRs welcome. - ### Install Automated Explorer 1. Select `Window -> Package Manager` @@ -51,7 +43,6 @@ This setup will work out of the box, but there are a great many options that all We are a big fan of enabling our users to improve the Automated Explorer Cam, so we would encourage you to use the source code, it's not much harder than using the latest release. 1. Create a Unity project within which to do your camera dev work - 2. Install Sensor toolike as described above 3. Add `Cinemachine` using the package manager 4. Fork the project on GitHub by clicking the icon in the top right 5. Clone the repo into your Unity projects Asset folder `git clone [YOUR_FORK_URL]` diff --git a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef index fe813d2..d307a59 100644 --- a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef +++ b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef @@ -3,8 +3,12 @@ "rootNamespace": "", "references": [ "wizardscode.ai.explorer", +<<<<<<< Updated upstream "Cinemachine", - "micosmo.sensortoolkit" + "microsmo.sensortoolkit" +======= + "Cinemachine" +>>>>>>> Stashed changes ], "includePlatforms": [ "Editor" diff --git a/Scripts/Runtime/Animation.meta b/Scripts/Runtime/Animation.meta new file mode 100644 index 0000000..529faed --- /dev/null +++ b/Scripts/Runtime/Animation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4416828ff75eb94a8c256ccaf390aef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index c901588..db4129f 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -4,15 +4,13 @@ using Random = UnityEngine.Random; using System.Linq; using UnityEngine.Serialization; -using WizardsCode.AI; namespace WizardsCode.Spawning { public class BoxAreaSpawner : MonoBehaviour { - //FIXME: generalize this so the spawner can be used for other items, not just WayPoints [SerializeField, Tooltip("The item we want to spawn using this spawner.")] - public WayPoint ToSpawn; + public GameObject ToSpawn; [SerializeField, Tooltip("The number of items to spawn at start.")] public int StartSpawnAmount; [SerializeField, Tooltip("The total number of items to have spawned. If an of the spawned items are destroyed then new ones will be spawned.")] @@ -31,12 +29,12 @@ public class BoxAreaSpawner : MonoBehaviour public float maxHeight = 7; [Header("Positioning")] - [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be under the max height above the terrain or mesh objects at the coordinates.")] - [FormerlySerializedAs("AdjustToTerrainHeight")] - public bool AdjustHeight = true; - [SerializeField, Tooltip("Set to true if you want to allow spawn points below water. If false then items spawned by this spawner will have their height adjusted to be under the max height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is false then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] - [FormerlySerializedAs("SpawnAboveWater")] // changed 1/29 - public bool SpawnBelowWater = false; + [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the terrain height at the spawn coordinates.")] + public bool AdjustToTerrainHeight = true; + [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is true then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] + public bool SpawnAboveWater = true; + [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] + public float ClearRadius = 1.8f; [SerializeField, Tooltip("The layers to look for obsructions when spawning.")] public LayerMask ObstructingLayers; @@ -48,7 +46,6 @@ public class BoxAreaSpawner : MonoBehaviour float spawnCountdown; GameObject[] spawned; - private int instanceCount; void Awake() { @@ -65,18 +62,7 @@ void Start() void OnEnable() { - if (Application.isPlaying) - { - StartCoroutine(SpawnRoutine()); - } - } - - private void OnDisable() - { - if (Application.isPlaying) - { - StopAllCoroutines(); - } + StartCoroutine(SpawnRoutine()); } IEnumerator SpawnRoutine() @@ -110,9 +96,6 @@ void Spawn() spawnCountdown = SpawnInterval; var nextSlot = nextAvailableSlot; if (nextSlot == -1) return; // No spawn slots available - - //OPTIMIZATION: Use a pool - WayPoint go = Instantiate(ToSpawn) as WayPoint; int nTrys = 0; Vector3 pos; @@ -124,28 +107,22 @@ void Spawn() Debug.LogWarning("Failed to find spawn location after 10 tries, aborting.", gameObject); return; } - pos = ChooseLocation(go); - } while (LocationIsObstructed(pos, go)); + pos = ChooseLocation(); + } while (LocationIsObstructed(pos)); - go.transform.SetPositionAndRotation(pos, transform.rotation); - go.name += instanceCount++; - go.transform.SetParent(transform.parent); - spawned[nextSlot] = go.gameObject; + var newInst = Instantiate(ToSpawn, pos, transform.rotation) as GameObject; + newInst.transform.SetParent(transform.parent); + spawned[nextSlot] = newInst; } - /// - /// Shoose a suitable location for an object to spawn. - /// - /// - /// - Vector3 ChooseLocation(WayPoint go) + Vector3 ChooseLocation() { Vector3 dimensions = new Vector3(SizeX / 2f, maxHeight - minHeight, SizeZ / 2f); - Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(0, 1f), Random.Range(-1f, 1f)); + Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 pos = Vector3.Scale(dimensions, randNormalizedVector) + transform.position; - pos.y += minHeight - transform.position.y; + pos.y += minHeight; - pos = GetHeightAdjusted(pos, go); + pos = GetHeightAdjusted(pos); return pos; } @@ -153,56 +130,61 @@ Vector3 ChooseLocation(WayPoint go) /// /// Adjust the height of a position in the terrain to allow for any obstructions on the terrain. /// - /// The approximate position the object should be placed - /// The game object to place at the position + /// /// - private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) + private Vector3 GetHeightAdjusted(Vector3 pos) { - if (!AdjustHeight && SpawnBelowWater) return pos; - - float clearance; - if (go == null) - { - clearance = 0.2f; - } - else - { - clearance = (go.ClearRadius * 1.05f); - } + if (!AdjustToTerrainHeight && !SpawnAboveWater) return pos; + + float clearance = (ClearRadius * 1.05f); - //TODO: consider using just raycast, do we really need to measure terrain heigh. Consider that this will not take into account items onthe terrain, - RaycastHit hit; - float height = 0; - bool hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); - if (hasHit) + if (AdjustToTerrainHeight) { - height = hit.distance; - - if (AdjustHeight) + Terrain terrain = null; + if (Terrain.activeTerrains.Length == 1) + { + terrain = Terrain.activeTerrain; + } + else { - if (pos.y < height + clearance) + terrain = Terrain.activeTerrains.OrderBy(x => { - pos.y = height + clearance; - } - else if (pos.y - height > maxHeight) + Vector3 terrainPosition = x.transform.position; + Vector3 terrainSize = x.terrainData.size * 0.5f; + Vector3 terrainCenter = new Vector3(terrainPosition.x + terrainSize.x, terrainPosition.y, terrainPosition.z + terrainSize.z); + return Vector3.SqrMagnitude(terrainCenter - pos); + }).First(); + } + + if (terrain != null) + { + float terrainHeight = terrain.SampleHeight(pos); + + if (pos.y < terrainHeight + clearance) { - pos.y = height + Random.Range(height + clearance, height + maxHeight); - } - else + pos.y = terrain.transform.position.y + terrainHeight + clearance; + } else if (pos.y - terrainHeight > maxHeight) { - Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); + pos.y = terrain.transform.position.y + Random.Range(terrainHeight + clearance, terrainHeight + maxHeight); } } + else + { + Debug.LogError($"No terrain found for {pos} while AdjustToTerrainheight is true."); + } + } - if (!SpawnBelowWater) + if (SpawnAboveWater) + { + RaycastHit hit; + if (Physics.Raycast(pos, Vector3.up, out hit, Mathf.Infinity)) { float waterHeight = hit.distance; if (pos.y < waterHeight + clearance) { pos.y = waterHeight + clearance; - } - else if (pos.y - waterHeight > maxHeight) + } else if (pos.y - waterHeight > maxHeight) { pos.y = waterHeight + Random.Range(clearance, maxHeight); } @@ -212,9 +194,9 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) return pos; } - bool LocationIsObstructed(Vector3 location, WayPoint go) + bool LocationIsObstructed(Vector3 location) { - return Physics.CheckSphere(location, go.ClearRadius, ObstructingLayers); + return Physics.CheckSphere(location, ClearRadius, ObstructingLayers); } public void OnDrawGizmosSelected() @@ -229,13 +211,10 @@ public void OnDrawGizmosSelected() // Red sphere marking the center of the box Gizmos.color = Color.red; - Gizmos.DrawSphere(GetHeightAdjusted(transform.position, null), Mathf.Max(0.2f, 0.2f)); + Gizmos.DrawSphere(GetHeightAdjusted(transform.position), Mathf.Max(0.2f, ClearRadius)); if (m_ShowAvailable || m_ShowUnavailable) { - //OPTIMIZATION: Use a cached sample object (See start of method as well) - WayPoint go = Instantiate(ToSpawn) as WayPoint; - float depth = SizeX / 2; float xInterval = Mathf.Max(0.3f, SizeX / 20); float height = maxHeight / 2; @@ -251,13 +230,13 @@ public void OnDrawGizmosSelected() { { Vector3 pos = transform.position + new Vector3(-width + x, -height + y, -depth + z); - pos = GetHeightAdjusted(pos, go); - if (m_ShowAvailable && !LocationIsObstructed(pos, go)) + pos = GetHeightAdjusted(pos); + if (m_ShowAvailable && !LocationIsObstructed(pos)) { Gizmos.color = Color.green; Gizmos.DrawSphere(pos, 0.2f); } - else if (m_ShowUnavailable && LocationIsObstructed(pos, go)) + else if (m_ShowUnavailable && LocationIsObstructed(pos)) { Gizmos.color = Color.red; Gizmos.DrawSphere(pos, 0.2f); @@ -266,9 +245,6 @@ public void OnDrawGizmosSelected() } } } - - //OPTIMIZATION: Use a cached sample object (See start of method as well) - DestroyImmediate(go); } } } diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 3b047e1..00d288a 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -1,5 +1,10 @@ using UnityEngine; +<<<<<<< Updated upstream using SensorToolkit; +using UnityEngine.Serialization; +======= +using System.Collections.Generic; +>>>>>>> Stashed changes #if PHOTOSESSION_PRESENT using Rowlan.PhotoSession; #endif @@ -12,29 +17,43 @@ public class MoveToWaypoint : MonoBehaviour enum SelectionStrategy { nearest, furthest, random }; [Header("Sensors")] +<<<<<<< Updated upstream [SerializeField, Tooltip("The sensor for detecting waypoints.")] - RangeSensor m_WaypointSensor; + Sensor WaypointSensor; [SerializeField, Tooltip("The sensor for detecting when the target waypoint has been reached.")] - TriggerSensor m_WaypoinArrivalSensor; + Sensor WaypoinArrivalSensor; + [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] + WayPoint waypointPrefab; +======= [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] WayPoint m_waypointPrefab; + [SerializeField, Tooltip("The range of the waypoint sensor this body has.")] + float m_sensorRange =200; + [SerializeField, Tooltip("The layers on which waypoints will be detected by this body")] + LayerMask m_detectsOnLayers = 1 << 0; // default +>>>>>>> Stashed changes [SerializeField, Tooltip("Strategy for selecting the next waypoint when one is not currently selected.")] - SelectionStrategy m_SelectionStrategy = SelectionStrategy.nearest; + SelectionStrategy strategy = SelectionStrategy.nearest; [SerializeField, Tooltip("Randomness in the selection of the next waypoint. The higher this value the more randomness there will be."), Range(0f, 1f)] - float m_SelectionRandomness = 0.2f; - /* +<<<<<<< Updated upstream + float randomness = 0.2f; [SerializeField, Tooltip("The radius that is used for the turning circle of the body. 0 means the body can turn on the spot. Note that a turning radius that is too close to the Waypoint Arrival sensor range will likely cause problems.")] [Range(0f, 100f)] - float m_TurningRadius = 15; - */ + float turningRadius = 15; +======= + float m_SelectionRandomness = 0.2f; +>>>>>>> Stashed changes [Header("Steering")] [SerializeField, Tooltip("The rig for steering towards the currently selected waypoint.")] - FlyingSteeringRig m_SteeringRig; + [FormerlySerializedAs("Steering")] // changed 1/23/22 + SteeringRig SteeringRig; [SerializeField, Tooltip("How long should the object be in the same place, if it has an existing waypoint destination, before it is assumed to be stuck. When stuck a new waypoint will be created a few meters away roughly behind the current position.")] - float m_StuckDuration = 0.5f; + float stuckDuration = 0.5f; [SerializeField, Tooltip("The tolerance to use when deciding if the item is stuck. If the object moves more than this distance in any direction in the `stuckDuration` then it will be considered to be moving.")] - float m_StuckTolerance = 0.05f; + float stuckTolerance = 0.05f; + [SerializeField, Tooltip("If set to true the sensor rig will be set to rotate towards the selected target waypoint.")] + bool faceTowardsTarget = false; [Header("Arrival Behaviours")] [SerializeField, Tooltip("If you have [Photo Session](https://github.com/TheWizardsCode/PhotoSession) and this setting is true then a new photo will be taken each time the target reaches a waypoint. " + @@ -52,6 +71,11 @@ enum SelectionStrategy { nearest, furthest, random }; Vector3 oldPosition = Vector3.zero; float timeToStuck; float sqrStuckTolerance; + + private WayPoint nextWaypoint; + private WayPoint lastWaypoint; + private Collider[] collidersCache; + private List detectedWaypoints = new List(); #if PHOTOSESSION_PRESENT PhotoSession photoSession; #endif @@ -60,10 +84,18 @@ private void Start() { if (m_RandomizeStartingPosition) { - m_WaypointSensor.Pulse(); - if (m_WaypointSensor.DetectedObjects.Count > 0) +<<<<<<< Updated upstream + WaypointSensor.Pulse(); + if (WaypointSensor.DetectedObjects.Count > 0) + { + WayPoint start = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); +======= + Pulse(); + + if (detectedWaypoints.Count > 0) { - WayPoint start = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); + WayPoint start = detectedWaypoints[Random.Range(0, detectedWaypoints.Count)].GetComponent(); +>>>>>>> Stashed changes if (start) { transform.position = start.transform.position; @@ -72,17 +104,33 @@ private void Start() } } - timeToStuck = m_StuckDuration; - sqrStuckTolerance = m_StuckTolerance * m_StuckTolerance; + timeToStuck = stuckDuration; + sqrStuckTolerance = stuckTolerance * stuckTolerance; #if PHOTOSESSION_PRESENT photoSession = GameObject.FindObjectOfType(); #endif } - private WayPoint nextWaypoint; - private WayPoint lastWaypoint; - + /// + /// Scan for Waypoints withing the sensor range. Available waypoints + /// will be stored in `detectedWaypoints. + /// + private void Pulse() + { + WayPoint waypoint; + detectedWaypoints.Clear(); + //Optimization: use NonAlloc and manually managed cache size.s + collidersCache = Physics.OverlapSphere(transform.position, m_sensorRange, m_detectsOnLayers, QueryTriggerInteraction.Collide); + for (int i = 0; i < collidersCache.Length; i++) + { + waypoint = collidersCache[i].GetComponent(); + if (waypoint) + { + detectedWaypoints.Add(waypoint); + } + } + } WayPoint currentWaypoint { get @@ -95,9 +143,17 @@ WayPoint currentWaypoint if (m_currentWaypoint != value) { m_currentWaypoint = value; - if (currentWaypoint != null && m_SteeringRig != null) + if (m_currentWaypoint != null) { - m_SteeringRig.destination = currentWaypoint.transform; + SteeringRig.IgnoreList.Clear(); + SteeringRig.IgnoreList.Add(m_currentWaypoint.gameObject); + SteeringRig.IgnoreList.Add(gameObject); + SteeringRig.DestinationTransform = m_currentWaypoint.transform; + + if (faceTowardsTarget) + { + SteeringRig.FaceTowardsTransform = m_currentWaypoint.transform; + } } } } @@ -113,7 +169,7 @@ bool IsStuck } else { oldPosition = transform.position; - timeToStuck = m_StuckDuration; + timeToStuck = stuckDuration; } return timeToStuck <= 0; @@ -126,24 +182,31 @@ void Update() { OnWaypointArrival(); - Vector3 pos = -transform.forward * Random.Range(2.5f, 3.5f); + Vector3 pos = -transform.forward * Random.Range(SteeringRig.StoppingDistance * 2.5f, SteeringRig.StoppingDistance * 3.5f); pos += transform.right * Random.Range(-0.5f, -0.5f); pos += transform.up * Random.Range(0.5f, 1f); - - GameObject go = Instantiate(m_waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); + GameObject go = Instantiate(waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); go.name = stuckWaypointName; currentWaypoint = go.GetComponent(); oldPosition = transform.position; - timeToStuck = m_StuckDuration; + timeToStuck = stuckDuration; - m_WaypointSensor.Pulse(); +<<<<<<< Updated upstream + WaypointSensor.Pulse(); +======= + Pulse(); +>>>>>>> Stashed changes } if (!currentWaypoint) { SelectNewWaypoint(); } - else if (m_WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) +<<<<<<< Updated upstream + else if (WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) +======= + else if (m_SteeringRig.hasReachedDestination) +>>>>>>> Stashed changes { OnWaypointArrival(); } @@ -172,7 +235,11 @@ private void OnWaypointArrival() { currentWaypoint.Disable(); } - m_WaypointSensor.Pulse(); +<<<<<<< Updated upstream + WaypointSensor.Pulse(); +======= + Pulse(); +>>>>>>> Stashed changes lastWaypoint = currentWaypoint; currentWaypoint = null; @@ -199,6 +266,12 @@ private void OnWaypointArrival() /// private void SelectNewWaypoint() { + if (m_SteeringRig.isGrounded) + { + Debug.Log("MoveToWayPoint does not support ground movement yet."); + return; + } + if (nextWaypoint != null) { currentWaypoint = nextWaypoint; @@ -212,7 +285,12 @@ private void SelectNewWaypoint() } else { +<<<<<<< Updated upstream + switch (strategy) +======= + Pulse(); switch (m_SelectionStrategy) +>>>>>>> Stashed changes { case SelectionStrategy.nearest: currentWaypoint = GetWeightedNearestFromPointWithComponent(transform.position); @@ -221,51 +299,82 @@ private void SelectNewWaypoint() currentWaypoint = GetWeightedFurthestFromPointWithComponent(transform.position); break; case SelectionStrategy.random: - if (m_WaypointSensor.DetectedObjects.Count > 0) +<<<<<<< Updated upstream + if (WaypointSensor.DetectedObjects.Count > 0) + { + currentWaypoint = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); +======= + if (detectedWaypoints.Count > 0) { - currentWaypoint = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); + currentWaypoint = detectedWaypoints[Random.Range(0, detectedWaypoints.Count)].GetComponent(); +>>>>>>> Stashed changes } break; default: - Debug.LogError("Unknown selection strategy: " + m_SelectionStrategy); + Debug.LogError("Unknown selection strategy: " + strategy); break; } } } - if (currentWaypoint == null) return; +<<<<<<< Updated upstream + if (currentWaypoint == null || turningRadius == 0) return; - /* create a turning circle if the next waypoint will cause the body to flip Transform root = transform.root; Vector3 heading = currentWaypoint.transform.position - root.position; - float dot = Vector3.Dot(heading.normalized, root.forward.normalized); - if ( dot < 0.3) + float dot = Vector3.Dot(heading, root.forward); + if ( dot < 0.5) { nextWaypoint = currentWaypoint; - currentWaypoint = Instantiate(m_waypointPrefab); + currentWaypoint = Instantiate(waypointPrefab); currentWaypoint.name = $"Turning waypoint (heading to {nextWaypoint})."; - currentWaypoint.reEnableWaitTime = 0; + Vector3 leftRight = Vector3.zero; + if (Vector3.SignedAngle(currentWaypoint.transform.position, root.position, Vector3.up) > 0) { + leftRight = root.right; + } else + { + leftRight = -root.right; + } - //TODO: Don't always turn right, decide the least obstructed path and go that way - Vector3 pos = transform.position + (root.right * m_TurningRadius) + (root.forward * m_TurningRadius) + (root.up * 2); + Vector3 pos = transform.position + (leftRight * turningRadius) + (root.forward * turningRadius); //FIXME: this needs to be set at a height above the terrain as there is a danger that it will be set into a slope and be inacessible pos.y = root.position.y; currentWaypoint.transform.position = pos; +======= + if (currentWaypoint == null) return; + } + + // Returns a list of detected Waypoints ordered by their distance from the body. + public List DetectedObjectsOrderedByDistance + { + get + { + List detectedWaypointsOrderedByDistance = new List(); + detectedWaypointsOrderedByDistance.Clear(); + detectedWaypointsOrderedByDistance.AddRange(detectedWaypoints); + DistanceComparer comparer = new DistanceComparer(); + comparer.position = transform.position; + detectedWaypointsOrderedByDistance.Sort(comparer); + return detectedWaypointsOrderedByDistance; +>>>>>>> Stashed changes } - */ } private WayPoint GetWeightedFurthestFromPointWithComponent(Vector3 point) { WayPoint furthest = null; var furthestDistance = 0f; - var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; +<<<<<<< Updated upstream + var gos = WaypointSensor.DetectedObjectsOrderedByDistance; +======= + var gos = DetectedObjectsOrderedByDistance; +>>>>>>> Stashed changes for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = waypoint.weight + Random.Range(0, m_SelectionRandomness); + float weight = waypoint.weight + Random.Range(0, randomness); var weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (furthest == null || weightedDistance > furthestDistance) { @@ -280,13 +389,17 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) { WayPoint nearest = null; var nearestDistance = 0f; - var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; +<<<<<<< Updated upstream + var gos = WaypointSensor.DetectedObjectsOrderedByDistance; +======= + var gos = DetectedObjectsOrderedByDistance; +>>>>>>> Stashed changes for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = 1.001f - (waypoint.weight + Random.Range(0, m_SelectionRandomness)); + float weight = 1.001f - (waypoint.weight + Random.Range(0, randomness)); float weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (nearest == null || weightedDistance < nearestDistance) @@ -297,14 +410,30 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) } return nearest; } +<<<<<<< Updated upstream +======= private void OnValidate() { if (m_SteeringRig == null) m_SteeringRig = GetComponentInChildren(); + } + } - if (m_WaypointSensor == null) m_WaypointSensor = GetComponentInChildren(); - - if (m_WaypoinArrivalSensor == null) m_WaypoinArrivalSensor = GetComponentInChildren(); + public class DistanceComparer : IComparer + { + public Vector3 position; + public int Compare(WayPoint x, WayPoint y) + { + var d1 = Vector3.SqrMagnitude(x.transform.position - position); + var d2 = Vector3.SqrMagnitude(y.transform.position - position); + if (d1 < d2) { + return -1; + } else if (d1 > d2) { + return 1; + } else { + return 0; + } } +>>>>>>> Stashed changes } } \ No newline at end of file diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 91d78d3..f977daf 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -36,9 +36,11 @@ public class FlyingSteeringRig : MonoBehaviour " If this is true the following settings will confine the height.")] bool m_MaintainHeight = true; [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + - " should be. This is used as a validation check to ensure the object is not going below" + - " the terrain or through a mesh obstacles in the scene.")] + " should be. The body will always try to get higher if it drops below this height.")] float m_MinHeight = 1.5f; + [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + + " automatically land.")] + float m_LandingHeight = 0.5f; [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + " should be. This is used as a validation check to ensure the object is not going too" + " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + @@ -124,13 +126,46 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } } - private bool hasReachedDestination + internal bool hasReachedDestination { get { return (rigidbody.transform.position - destination.position).magnitude <= m_ArrivalDistance; } } + + /// + /// Returns true if the body is currently on the ground. + /// + public bool isGrounded { + get + { + return height <= 0.01f; + } + } + + /// + /// Returns the current height of the body above the nearest obstacle below it. + /// + public float height { + get + { + //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame + + RaycastHit hit; + if (Physics.Raycast(rigidbody.position, Vector3.down, out hit, Mathf.Infinity)) + { + return hit.distance; + } else + { + Debug.LogError("The raycast to get body height didn't hit anything. Returning a height of infinity, but this likely shouldn't happen."); + return Mathf.Infinity; + } + } + } + + bool m_isLanding = false; + protected virtual void FixedUpdate() { if (destination == null) return; @@ -141,23 +176,57 @@ protected virtual void FixedUpdate() return; } + if (isGrounded) + { + GroundMovement(); + } + else + { + FlightPhysics(); + } + } + + /// + /// Cacluate movement of the body when on the ground. + /// + private void GroundMovement() + { + Vector3 moveDirection = Vector3.zero; + + // take off + moveDirection = new Vector3(0, 1, 1); + + // Add the forces + //rigidbody.transform.Translate(Vector3.Lerp(rigidbody.transform.position, rigidbody.transform.TransformDirection(moveDirection), Time.deltaTime)); + } + + /// + /// Calculates the forces to put on the body for the current conditions. + /// + private void FlightPhysics() + { Vector3 desiredDirection = (destination.position - rigidbody.transform.position); - Vector3 moveDirection = Vector3.zero; + Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) { moveDirection += desiredDirection.normalized; - } else + } + else { moveDirection += desiredDirection; } - - Vector3 repulsion = GetRepulsionDirection(); - if (repulsion.sqrMagnitude > 0.01f) - { - moveDirection += repulsion.normalized; - } else + + if (!m_isLanding) { - moveDirection += repulsion * 100; + Vector3 repulsion = GetRepulsionDirection(); + if (repulsion.sqrMagnitude > 0.01f) + { + moveDirection += repulsion.normalized; + } + else + { + moveDirection += repulsion * 100; + } } // Rotate towards the desired direction @@ -175,7 +244,7 @@ protected virtual void FixedUpdate() float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; rigidbody.AddTorque(rigidbody.transform.forward * -force); - SetAnimationParameters(moveDirection); + SetAnimationParameters(); // Forward force to add float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); @@ -184,39 +253,75 @@ protected virtual void FixedUpdate() // Vertical force to add float verticalDotMove = Vector3.Dot(Vector3.up, moveDirection.normalized); float verticalForce = 0; - if (verticalDotMove > 0) { + if (verticalDotMove > 0) + { verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); } // Add the forces - rigidbody.AddForce((forwardForce * moveDirection.normalized) + rigidbody.AddForce((forwardForce * moveDirection.normalized) + (verticalForce * rigidbody.transform.up)); // Don't go over maximum speed rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed); } - void SetAnimationParameters(Vector3 moveDirection) + /// + /// Set the animation parameters for the current state + /// + void SetAnimationParameters() { if (!m_Animator) return; + if (isGrounded) + { + SetGroundAnimationParameters(); + } + else + { + SetFlightAnimationParameters(); + } + } + + private void SetGroundAnimationParameters() + { + //OPTIMIZATION: Use hash not string + m_Animator.SetBool("isGrounded", true); + m_isLanding = false; + m_Animator.SetBool("land", false); + } + + private void SetFlightAnimationParameters() + { + float verticalVelocity = rigidbody.velocity.normalized.y; + //OPTIMIZATION: Use Hash not string + if (m_isLanding) + { + m_Animator.SetBool("land", true); + return; + } else + { + m_Animator.SetBool("land", false); + } + + m_Animator.SetBool("isGrounded", false); Quaternion q = rigidbody.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); - float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); + //float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); float pitch; if (pitchRad <= 0) // up { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxClimbAngle; - } else + } + else { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxDiveAngle; } - float yaw = yawRad / 1.52f; + //float yaw = yawRad / 1.52f; float roll = rollRad / 3.14f; float strafeVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.x; - float verticalVelocity = rigidbody.velocity.normalized.y; float forwardVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.z; bool glide = false; @@ -225,12 +330,12 @@ void SetAnimationParameters(Vector3 moveDirection) glide = pitch > -0.2 && pitch < 0.2; } - //OPTIMIZATION: Use Hash not string m_Animator.SetFloat("yaw", strafeVelocity); if (pitch <= 0) // up { m_Animator.SetFloat("pitch", pitch); - } else // down + } + else // down { m_Animator.SetFloat("pitch", pitch); } diff --git a/Scripts/Runtime/WayPoint.cs b/Scripts/Runtime/WayPoint.cs index 4ef8670..cf8c23e 100644 --- a/Scripts/Runtime/WayPoint.cs +++ b/Scripts/Runtime/WayPoint.cs @@ -13,11 +13,9 @@ namespace WizardsCode.AI /// public class WayPoint : MonoBehaviour { - [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] - public float ClearRadius = 1.8f; [SerializeField, Tooltip("The relative weight of this waypoint in terms of it's interest. A higher value will increase the chances of this waypoint being selected all other choice factors being equal."), Range(0.001f, 1f)] internal float weight = 0.5f; - [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will destroyed once visited.")] + [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will not be re-enabled.")] internal float reEnableWaitTime = 0; [SerializeField, Tooltip("If set the next waypoint selected will be the one set here, assuming that it is still present in the scene.")] public WayPoint NextWaypoint; @@ -72,9 +70,6 @@ public void Disable() if (reEnableWaitTime > 0) { timeToReEnable = Time.timeSinceLevelLoad + reEnableWaitTime; - } else - { - Destroy(this.gameObject); } } @@ -90,7 +85,7 @@ public void Enable() private void OnDrawGizmos() { Gizmos.color = Color.blue; - Gizmos.DrawSphere(transform.position, ClearRadius); + Gizmos.DrawSphere(transform.position, 0.2f); } } } \ No newline at end of file diff --git a/Scripts/Runtime/wizardscode.ai.explorer.asmdef b/Scripts/Runtime/wizardscode.ai.explorer.asmdef index b8fb5b5..9f4de7a 100644 --- a/Scripts/Runtime/wizardscode.ai.explorer.asmdef +++ b/Scripts/Runtime/wizardscode.ai.explorer.asmdef @@ -2,8 +2,12 @@ "name": "wizardscode.ai.explorer", "rootNamespace": "", "references": [ +<<<<<<< Updated upstream "PhotoSession.Runtime", - "micosmo.sensortoolkit" + "microsmo.sensortoolkit" +======= + "PhotoSession.Runtime" +>>>>>>> Stashed changes ], "includePlatforms": [], "excludePlatforms": [], From 5d6a00e040a9996274e5a1d016bae38940dc6bd0 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 00:03:40 -0800 Subject: [PATCH 09/36] Revert "Take off works, not landing yet. Replace waypoints code, thus allowing Sensor Toolkit to be removed as a dependency" This reverts commit 6fbaf41b1d461640351f0cebdd0707e5d2767b47. --- Animations/DragonController.controller | 639 ++---------------- .../Placeholders/Grounded - Idle 1.anim | 53 -- .../Placeholders/Grounded - Idle 1.anim.meta | 8 - .../Placeholders/Grounded - Idle 2.anim | 53 -- .../Placeholders/Grounded - Idle 2.anim.meta | 8 - .../Placeholders/Grounded - Idle 3.anim | 53 -- .../Placeholders/Grounded - Idle 3.anim.meta | 8 - Animations/Placeholders/Jump Forward.anim | 53 -- .../Placeholders/Jump Forward.anim.meta | 8 - Animations/Placeholders/Jump Run.anim | 53 -- Animations/Placeholders/Jump Run.anim.meta | 8 - Animations/Placeholders/Jump Up.anim | 53 -- Animations/Placeholders/Jump Up.anim.meta | 8 - Animations/Placeholders/UpFly Backwards.anim | 53 -- .../Placeholders/UpFly Backwards.anim.meta | 8 - .../Placeholders/UpFly Down Forward L.anim | 53 -- .../UpFly Down Forward L.anim.meta | 8 - .../Placeholders/UpFly Down Forward R.anim | 53 -- .../UpFly Down Forward R.anim.meta | 8 - Animations/Placeholders/UpFly Down.anim | 53 -- Animations/Placeholders/UpFly Down.anim.meta | 8 - Animations/Placeholders/UpFly L.anim | 53 -- Animations/Placeholders/UpFly L.anim.meta | 8 - Animations/Placeholders/UpFly R.anim | 53 -- Animations/Placeholders/UpFly R.anim.meta | 8 - Animations/Placeholders/UpFly Stand.anim | 53 -- Animations/Placeholders/UpFly Stand.anim.meta | 8 - Animations/Placeholders/UpFly Strafe L.anim | 53 -- .../Placeholders/UpFly Strafe L.anim.meta | 8 - Animations/Placeholders/UpFly Strafe R.anim | 53 -- .../Placeholders/UpFly Strafe R.anim.meta | 8 - Animations/Placeholders/UpFly Up Turn L.anim | 53 -- .../Placeholders/UpFly Up Turn L.anim.meta | 8 - Animations/Placeholders/UpFly Up Turn R.anim | 53 -- .../Placeholders/UpFly Up Turn R.anim.meta | 8 - Animations/Placeholders/UpFly Up.anim | 53 -- Animations/Placeholders/UpFly Up.anim.meta | 8 - Animations/Placeholders/UpFly.anim | 53 -- Animations/Placeholders/UpFly.anim.meta | 8 - Animations/Placeholders/UpGlide L.anim | 53 -- Animations/Placeholders/UpGlide L.anim.meta | 8 - Animations/Placeholders/UpGlide R.anim | 53 -- Animations/Placeholders/UpGlide R.anim.meta | 8 - Animations/Placeholders/UpGlide.anim | 53 -- Animations/Placeholders/UpGlide.anim.meta | 8 - Animations/Placeholders/Walk Forward.anim | 53 -- .../Placeholders/Walk Forward.anim.meta | 8 - Animations/Unka.overrideController | 23 +- Documentation/flyCam.md | 16 +- Prefabs/Large Creature Waypoint.prefab | 4 +- Prefabs/Large Creature Waypoint.prefab.meta | 5 +- Prefabs/Waypoint Spawner.prefab | 14 +- Prefabs/Waypoint.prefab | 6 +- README.md | 9 + .../wizardscode.ai.explorer.editor.asmdef | 6 +- Scripts/Runtime/Animation.meta | 8 - Scripts/Runtime/BoxAreaSpawner.cs | 146 ++-- Scripts/Runtime/MoveToWaypoint.cs | 223 ++---- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 149 +--- Scripts/Runtime/WayPoint.cs | 9 +- .../Runtime/wizardscode.ai.explorer.asmdef | 6 +- 61 files changed, 283 insertions(+), 2383 deletions(-) delete mode 100644 Animations/Placeholders/Grounded - Idle 1.anim delete mode 100644 Animations/Placeholders/Grounded - Idle 1.anim.meta delete mode 100644 Animations/Placeholders/Grounded - Idle 2.anim delete mode 100644 Animations/Placeholders/Grounded - Idle 2.anim.meta delete mode 100644 Animations/Placeholders/Grounded - Idle 3.anim delete mode 100644 Animations/Placeholders/Grounded - Idle 3.anim.meta delete mode 100644 Animations/Placeholders/Jump Forward.anim delete mode 100644 Animations/Placeholders/Jump Forward.anim.meta delete mode 100644 Animations/Placeholders/Jump Run.anim delete mode 100644 Animations/Placeholders/Jump Run.anim.meta delete mode 100644 Animations/Placeholders/Jump Up.anim delete mode 100644 Animations/Placeholders/Jump Up.anim.meta delete mode 100644 Animations/Placeholders/UpFly Backwards.anim delete mode 100644 Animations/Placeholders/UpFly Backwards.anim.meta delete mode 100644 Animations/Placeholders/UpFly Down Forward L.anim delete mode 100644 Animations/Placeholders/UpFly Down Forward L.anim.meta delete mode 100644 Animations/Placeholders/UpFly Down Forward R.anim delete mode 100644 Animations/Placeholders/UpFly Down Forward R.anim.meta delete mode 100644 Animations/Placeholders/UpFly Down.anim delete mode 100644 Animations/Placeholders/UpFly Down.anim.meta delete mode 100644 Animations/Placeholders/UpFly L.anim delete mode 100644 Animations/Placeholders/UpFly L.anim.meta delete mode 100644 Animations/Placeholders/UpFly R.anim delete mode 100644 Animations/Placeholders/UpFly R.anim.meta delete mode 100644 Animations/Placeholders/UpFly Stand.anim delete mode 100644 Animations/Placeholders/UpFly Stand.anim.meta delete mode 100644 Animations/Placeholders/UpFly Strafe L.anim delete mode 100644 Animations/Placeholders/UpFly Strafe L.anim.meta delete mode 100644 Animations/Placeholders/UpFly Strafe R.anim delete mode 100644 Animations/Placeholders/UpFly Strafe R.anim.meta delete mode 100644 Animations/Placeholders/UpFly Up Turn L.anim delete mode 100644 Animations/Placeholders/UpFly Up Turn L.anim.meta delete mode 100644 Animations/Placeholders/UpFly Up Turn R.anim delete mode 100644 Animations/Placeholders/UpFly Up Turn R.anim.meta delete mode 100644 Animations/Placeholders/UpFly Up.anim delete mode 100644 Animations/Placeholders/UpFly Up.anim.meta delete mode 100644 Animations/Placeholders/UpFly.anim delete mode 100644 Animations/Placeholders/UpFly.anim.meta delete mode 100644 Animations/Placeholders/UpGlide L.anim delete mode 100644 Animations/Placeholders/UpGlide L.anim.meta delete mode 100644 Animations/Placeholders/UpGlide R.anim delete mode 100644 Animations/Placeholders/UpGlide R.anim.meta delete mode 100644 Animations/Placeholders/UpGlide.anim delete mode 100644 Animations/Placeholders/UpGlide.anim.meta delete mode 100644 Animations/Placeholders/Walk Forward.anim delete mode 100644 Animations/Placeholders/Walk Forward.anim.meta delete mode 100644 Scripts/Runtime/Animation.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index b253672..6ce4939 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -11,7 +11,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} m_Threshold: 13 - m_Position: {x: -0.5, y: 0} + m_Position: {x: -0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -19,7 +19,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} m_Threshold: 18 - m_Position: {x: 0, y: 0} + m_Position: {x: 0, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -27,7 +27,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_Threshold: 23 - m_Position: {x: 0.5, y: 0} + m_Position: {x: 0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -35,7 +35,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} m_Threshold: 28 - m_Position: {x: -0.7, y: 1} + m_Position: {x: -0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -43,7 +43,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} m_Threshold: 33 - m_Position: {x: 0, y: 1} + m_Position: {x: 0, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -51,43 +51,18 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} m_Threshold: 38 - m_Position: {x: 0.7, y: 1} + m_Position: {x: 0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: angularVelocity - m_BlendParameterY: forwardVelocity + m_BlendParameter: yaw + m_BlendParameterY: verticalVelocity m_MinThreshold: 13 m_MaxThreshold: 38 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1101 &-6849355106312461386 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 3 - m_ConditionEvent: verticalVelocity - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1385069710956288641} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.90625 - m_HasExitTime: 0 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!206 &-6390963665721911578 BlendTree: m_ObjectHideFlags: 1 @@ -108,7 +83,7 @@ BlendTree: m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Threshold: 18 m_Position: {x: 0, y: 0} - m_TimeScale: 1.5 + m_TimeScale: 1.4 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 @@ -123,7 +98,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} m_Threshold: 26 - m_Position: {x: -0.7, y: 1} + m_Position: {x: -0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -131,7 +106,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} m_Threshold: 30 - m_Position: {x: 0, y: 1} + m_Position: {x: 0, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -139,94 +114,24 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_Threshold: 34 - m_Position: {x: 0.7, y: 1} + m_Position: {x: 0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: angularVelocity - m_BlendParameterY: forwardVelocity + m_BlendParameter: yaw + m_BlendParameterY: pitch m_MinThreshold: 14 m_MaxThreshold: 34 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 -<<<<<<< Updated upstream ---- !u!206 &-5110191505608462634 -BlendTree: -======= ---- !u!1109 &-6249805993816533927 -AnimatorTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7658257134381773050} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 1 --- !u!1101 &-5621913499797024570 AnimatorStateTransition: ->>>>>>> Stashed changes m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} -<<<<<<< Updated upstream - m_Name: Blend Tree - m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 87905e8efc51e9848a1d33a36aa95157, type: 2} - m_Threshold: 0 - m_Position: {x: -1, y: 3} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 14bbf774c9a3ed949b3f10dd1f5037e7, type: 2} - m_Threshold: 0.25 - m_Position: {x: -0, y: 6} - m_TimeScale: 1.2 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_Threshold: 0.5 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: d99d545b590dd754db3eaf4891ad104b, type: 2} - m_Threshold: 0.75 - m_Position: {x: 1, y: 3} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 18aa6846075b13e43b13bc3b3307791e, type: 2} - m_Threshold: 1 - m_Position: {x: 0, y: -4} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: X - m_Mirror: 0 - m_BlendParameter: angularVelocity - m_BlendParameterY: forwardVelocity - m_MinThreshold: 0 - m_MaxThreshold: 1 - m_UseAutomaticThresholds: 1 - m_NormalizedBlendValues: 0 - m_BlendType: 1 -======= m_Name: m_Conditions: - m_ConditionMode: 1 @@ -246,95 +151,6 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1102 &-2862842708842554754 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Land - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 897241709742554265} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7518922156995010553} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1101 &-2549987733969162959 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7929321913217887456} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.45 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!206 &-2355690225596318970 -BlendTree: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Blend Tree - m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} - m_Threshold: 0 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} - m_Threshold: 0.33 - m_Position: {x: 0, y: 0.4} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} - m_Threshold: 1 - m_Position: {x: 0, y: 1} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - m_BlendParameter: forwardVelocity - m_BlendParameterY: forwardVelocity - m_MinThreshold: 0 - m_MaxThreshold: 1 - m_UseAutomaticThresholds: 0 - m_NormalizedBlendValues: 0 - m_BlendType: 0 ->>>>>>> Stashed changes --- !u!1107 &-2323046387310864844 AnimatorStateMachine: serializedVersion: 6 @@ -345,42 +161,24 @@ AnimatorStateMachine: m_Name: Base Layer m_ChildStates: - serializedVersion: 1 -<<<<<<< Updated upstream - m_State: {fileID: 7320282026098016608} - m_Position: {x: 480, y: -220, z: 0} - - serializedVersion: 1 - m_State: {fileID: 7929321913217887456} - m_Position: {x: 480, y: 110, z: 0} -======= m_State: {fileID: 7929321913217887456} - m_Position: {x: 550, y: 110, z: 0} + m_Position: {x: 470, y: 110, z: 0} - serializedVersion: 1 m_State: {fileID: 3062000143290070295} - m_Position: {x: 830, y: 110, z: 0} + m_Position: {x: 470, y: 270, z: 0} - serializedVersion: 1 - m_State: {fileID: 1385069710956288641} - m_Position: {x: 550, y: -70, z: 0} - - serializedVersion: 1 - m_State: {fileID: 7658257134381773050} - m_Position: {x: 270, y: 110, z: 0} - - serializedVersion: 1 - m_State: {fileID: -2862842708842554754} - m_Position: {x: 540, y: 280, z: 0} ->>>>>>> Stashed changes + m_State: {fileID: -1651374198255606467} + m_Position: {x: 532.09485, y: -64.83923, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] - m_EntryTransitions: - - {fileID: -6249805993816533927} + m_EntryTransitions: [] m_StateMachineTransitions: {} m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 1070, y: 280, z: 0} + m_AnyStatePosition: {x: 50, y: 20, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0} - m_ExitPosition: {x: 1130, y: 100, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} -<<<<<<< Updated upstream m_DefaultState: {fileID: 7929321913217887456} -======= - m_DefaultState: {fileID: 7658257134381773050} --- !u!1101 &-2227351312352247077 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -406,7 +204,32 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ->>>>>>> Stashed changes +--- !u!1102 &-1651374198255606467 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Hover + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 @@ -416,27 +239,6 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: -<<<<<<< Updated upstream - - m_Name: angularVelocity -======= - - m_Name: isGrounded - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 1 - m_Controller: {fileID: 9100000} - - m_Name: land - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 0 - m_Controller: {fileID: 9100000} - - m_Name: glide - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 0 - m_Controller: {fileID: 9100000} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 @@ -450,7 +252,6 @@ AnimatorController: m_DefaultBool: 0 m_Controller: {fileID: 9100000} - m_Name: yaw ->>>>>>> Stashed changes m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 @@ -468,6 +269,12 @@ AnimatorController: m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 9100000} + - m_Name: glide + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -481,74 +288,6 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} -<<<<<<< Updated upstream -======= ---- !u!1109 &229971009591500439 -AnimatorTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 2 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 0} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 1 ---- !u!1101 &897241709742554265 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7658257134381773050} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.6666666 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1102 &1385069710956288641 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Take Off - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 7853129839041897887} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: -2355690225596318970} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: --- !u!206 &2091492798866408738 BlendTree: m_ObjectHideFlags: 1 @@ -588,31 +327,6 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 ---- !u!1101 &2751168201624032978 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 1 - m_ConditionEvent: land - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: -2862842708842554754} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 0 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!1102 &3062000143290070295 AnimatorState: serializedVersion: 6 @@ -640,60 +354,6 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: ---- !u!1101 &3965547454830397286 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 2 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7929321913217887456} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1109 &4255577577117572388 -AnimatorTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: -2323046387310864844} - m_DstState: {fileID: 0} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 1 ---- !u!1109 &4743579291339850867 -AnimatorTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: -2323046387310864844} - m_DstState: {fileID: 0} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 1 ->>>>>>> Stashed changes --- !u!206 &5237996256603445452 BlendTree: m_ObjectHideFlags: 1 @@ -705,38 +365,38 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 0.2 - m_Position: {x: -0.7, y: 0.7} + m_Position: {x: -0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} - m_Threshold: 0.2888889 - m_Position: {x: 0, y: 0.85} - m_TimeScale: 1.2 + m_Threshold: 0.2979592 + m_Position: {x: 0, y: 0.5} + m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} - m_Threshold: 0.37777779 - m_Position: {x: 0.7, y: 0.7} + m_Threshold: 0.39591837 + m_Position: {x: 0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} - m_Threshold: 0.4666667 - m_Position: {x: -0.6, y: 0} + m_Threshold: 0.4938776 + m_Position: {x: -0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Threshold: 0.5555556 + m_Threshold: 0.59183675 m_Position: {x: 0, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -744,171 +404,27 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} - m_Threshold: 0.64444447 - m_Position: {x: 0.6, y: 0} + m_Threshold: 0.689796 + m_Position: {x: 0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 158e99599478daf43ae8974ce40e44d2, type: 2} - m_Threshold: 0.73333335 + m_Threshold: 0.78775513 m_Position: {x: 0, y: -1} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} - m_Threshold: 0.82222223 - m_Position: {x: -1, y: 1} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} - m_Threshold: 0.9111111 - m_Position: {x: 0, y: 1} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} - m_Threshold: 1 - m_Position: {x: 1, y: 1} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: angularVelocity - m_Mirror: 0 - m_BlendParameter: angularVelocity + m_BlendParameter: yaw m_BlendParameterY: forwardVelocity m_MinThreshold: 0.2 - m_MaxThreshold: 1 + m_MaxThreshold: 0.78775513 m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 -<<<<<<< Updated upstream ---- !u!1102 &7320282026098016608 -======= ---- !u!1101 &7113365851612787807 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7929321913217887456} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.45 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!206 &7518922156995010553 -BlendTree: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Blend Tree - m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} - m_Threshold: 0.25 - m_Position: {x: 0, y: 0.4} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} - m_Threshold: 1 - m_Position: {x: 0, y: 1} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - m_BlendParameter: forwardVelocity - m_BlendParameterY: forwardVelocity - m_MinThreshold: 0.25 - m_MaxThreshold: 1 - m_UseAutomaticThresholds: 0 - m_NormalizedBlendValues: 0 - m_BlendType: 0 ---- !u!1102 &7658257134381773050 ->>>>>>> Stashed changes -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} -<<<<<<< Updated upstream - m_Name: Fly Level - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: [] -======= - m_Name: Grounded - Idle - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: -6849355106312461386} ->>>>>>> Stashed changes - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 -<<<<<<< Updated upstream - m_Motion: {fileID: -5110191505608462634} -======= - m_Motion: {fileID: 7400000, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} ->>>>>>> Stashed changes - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: -<<<<<<< Updated upstream -======= ---- !u!1101 &7853129839041897887 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7929321913217887456} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.45 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ->>>>>>> Stashed changes --- !u!1102 &7929321913217887456 AnimatorState: serializedVersion: 6 @@ -919,13 +435,8 @@ AnimatorState: m_Name: Flight m_Speed: 1 m_CycleOffset: 0 -<<<<<<< Updated upstream - m_Transitions: [] -======= m_Transitions: - {fileID: -5621913499797024570} - - {fileID: 2751168201624032978} ->>>>>>> Stashed changes m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -951,7 +462,7 @@ BlendTree: m_Childs: - serializedVersion: 2 m_Motion: {fileID: -8904977728813876417} - m_Threshold: -0.7 + m_Threshold: -0.2 m_Position: {x: -1, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -959,24 +470,24 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 5237996256603445452} - m_Threshold: 0 - m_Position: {x: 3, y: 0} + m_Threshold: 0.4 + m_Position: {x: 0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: -6390963665721911578} - m_Threshold: 0.8 + m_Threshold: 1 m_Position: {x: 1, y: 0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: verticalVelocity - m_BlendParameterY: verticalVelocity - m_MinThreshold: -0.7 - m_MaxThreshold: 0.8 + m_BlendParameter: pitch + m_BlendParameterY: pitch + m_MinThreshold: -0.2 + m_MaxThreshold: 1 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 diff --git a/Animations/Placeholders/Grounded - Idle 1.anim b/Animations/Placeholders/Grounded - Idle 1.anim deleted file mode 100644 index 98fed0b..0000000 --- a/Animations/Placeholders/Grounded - Idle 1.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Grounded - Idle 1 - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 1.anim.meta b/Animations/Placeholders/Grounded - Idle 1.anim.meta deleted file mode 100644 index 2fedab8..0000000 --- a/Animations/Placeholders/Grounded - Idle 1.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4831672f16dfe744d9678abaa1fb34d5 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Grounded - Idle 2.anim b/Animations/Placeholders/Grounded - Idle 2.anim deleted file mode 100644 index b601f0d..0000000 --- a/Animations/Placeholders/Grounded - Idle 2.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Grounded - Idle 2 - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 2.anim.meta b/Animations/Placeholders/Grounded - Idle 2.anim.meta deleted file mode 100644 index 33c95b3..0000000 --- a/Animations/Placeholders/Grounded - Idle 2.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 51cb2bd50c3f1374bbe8b099d7fb522c -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Grounded - Idle 3.anim b/Animations/Placeholders/Grounded - Idle 3.anim deleted file mode 100644 index 4773919..0000000 --- a/Animations/Placeholders/Grounded - Idle 3.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Grounded - Idle 3 - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Grounded - Idle 3.anim.meta b/Animations/Placeholders/Grounded - Idle 3.anim.meta deleted file mode 100644 index 34b1c43..0000000 --- a/Animations/Placeholders/Grounded - Idle 3.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0a91187913900d84ba38e9153afaebd7 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Jump Forward.anim b/Animations/Placeholders/Jump Forward.anim deleted file mode 100644 index bb6e420..0000000 --- a/Animations/Placeholders/Jump Forward.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Jump Forward - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Jump Forward.anim.meta b/Animations/Placeholders/Jump Forward.anim.meta deleted file mode 100644 index c2def89..0000000 --- a/Animations/Placeholders/Jump Forward.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d2e2cdc6cc0c04b40827eb81f9d8409a -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Jump Run.anim b/Animations/Placeholders/Jump Run.anim deleted file mode 100644 index 4086218..0000000 --- a/Animations/Placeholders/Jump Run.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Jump Run - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Jump Run.anim.meta b/Animations/Placeholders/Jump Run.anim.meta deleted file mode 100644 index 360c88b..0000000 --- a/Animations/Placeholders/Jump Run.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 70997ae4164ecb646949949ea2ece781 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Jump Up.anim b/Animations/Placeholders/Jump Up.anim deleted file mode 100644 index df43f3a..0000000 --- a/Animations/Placeholders/Jump Up.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Jump Up - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Jump Up.anim.meta b/Animations/Placeholders/Jump Up.anim.meta deleted file mode 100644 index 898de23..0000000 --- a/Animations/Placeholders/Jump Up.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bc1a19ae29c61de40a0fae09acdb0251 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Backwards.anim b/Animations/Placeholders/UpFly Backwards.anim deleted file mode 100644 index 0ed349d..0000000 --- a/Animations/Placeholders/UpFly Backwards.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Backwards - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Backwards.anim.meta b/Animations/Placeholders/UpFly Backwards.anim.meta deleted file mode 100644 index 6106787..0000000 --- a/Animations/Placeholders/UpFly Backwards.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 158e99599478daf43ae8974ce40e44d2 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down Forward L.anim b/Animations/Placeholders/UpFly Down Forward L.anim deleted file mode 100644 index c272ca7..0000000 --- a/Animations/Placeholders/UpFly Down Forward L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down Forward L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward L.anim.meta b/Animations/Placeholders/UpFly Down Forward L.anim.meta deleted file mode 100644 index cab0002..0000000 --- a/Animations/Placeholders/UpFly Down Forward L.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 865afa414143d9b4dbb47938baa15854 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down Forward R.anim b/Animations/Placeholders/UpFly Down Forward R.anim deleted file mode 100644 index 758818e..0000000 --- a/Animations/Placeholders/UpFly Down Forward R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down Forward R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Down Forward R.anim.meta b/Animations/Placeholders/UpFly Down Forward R.anim.meta deleted file mode 100644 index ebeeceb..0000000 --- a/Animations/Placeholders/UpFly Down Forward R.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b9df435da0377284ca1a151b641cf1d3 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Down.anim b/Animations/Placeholders/UpFly Down.anim deleted file mode 100644 index 770e2b7..0000000 --- a/Animations/Placeholders/UpFly Down.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Down - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Down.anim.meta b/Animations/Placeholders/UpFly Down.anim.meta deleted file mode 100644 index f8e9f11..0000000 --- a/Animations/Placeholders/UpFly Down.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5cc910c66b70fb04284254469d04f532 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly L.anim b/Animations/Placeholders/UpFly L.anim deleted file mode 100644 index bba9d4c..0000000 --- a/Animations/Placeholders/UpFly L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly L.anim.meta b/Animations/Placeholders/UpFly L.anim.meta deleted file mode 100644 index e40029e..0000000 --- a/Animations/Placeholders/UpFly L.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cc9cbc5b07c4f5d4ebee64760b87f7ab -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly R.anim b/Animations/Placeholders/UpFly R.anim deleted file mode 100644 index 1547ef6..0000000 --- a/Animations/Placeholders/UpFly R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly R.anim.meta b/Animations/Placeholders/UpFly R.anim.meta deleted file mode 100644 index 35df1ae..0000000 --- a/Animations/Placeholders/UpFly R.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ba3ade90af933bc4ea3f02fa11877300 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Stand.anim b/Animations/Placeholders/UpFly Stand.anim deleted file mode 100644 index af8cb1c..0000000 --- a/Animations/Placeholders/UpFly Stand.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Stand - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Stand.anim.meta b/Animations/Placeholders/UpFly Stand.anim.meta deleted file mode 100644 index fdc3e40..0000000 --- a/Animations/Placeholders/UpFly Stand.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 716784733869f5f44855acc139951a66 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Strafe L.anim b/Animations/Placeholders/UpFly Strafe L.anim deleted file mode 100644 index 6c809c3..0000000 --- a/Animations/Placeholders/UpFly Strafe L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Strafe L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe L.anim.meta b/Animations/Placeholders/UpFly Strafe L.anim.meta deleted file mode 100644 index d5f158f..0000000 --- a/Animations/Placeholders/UpFly Strafe L.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0b47b571577c971449a4f1f5d234b2fb -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Strafe R.anim b/Animations/Placeholders/UpFly Strafe R.anim deleted file mode 100644 index 055656f..0000000 --- a/Animations/Placeholders/UpFly Strafe R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Strafe R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Strafe R.anim.meta b/Animations/Placeholders/UpFly Strafe R.anim.meta deleted file mode 100644 index 58519a4..0000000 --- a/Animations/Placeholders/UpFly Strafe R.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7e26352eb41642447820642ab5e48ea5 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up Turn L.anim b/Animations/Placeholders/UpFly Up Turn L.anim deleted file mode 100644 index cf2958a..0000000 --- a/Animations/Placeholders/UpFly Up Turn L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up Turn L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn L.anim.meta b/Animations/Placeholders/UpFly Up Turn L.anim.meta deleted file mode 100644 index c956e7c..0000000 --- a/Animations/Placeholders/UpFly Up Turn L.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6ee1aad5e0fb6404e83daaa12fe3b60c -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up Turn R.anim b/Animations/Placeholders/UpFly Up Turn R.anim deleted file mode 100644 index 4f07ba9..0000000 --- a/Animations/Placeholders/UpFly Up Turn R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up Turn R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Up Turn R.anim.meta b/Animations/Placeholders/UpFly Up Turn R.anim.meta deleted file mode 100644 index 8b496a1..0000000 --- a/Animations/Placeholders/UpFly Up Turn R.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f5f6ad99c462a594b9a74b5934303e29 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly Up.anim b/Animations/Placeholders/UpFly Up.anim deleted file mode 100644 index da54396..0000000 --- a/Animations/Placeholders/UpFly Up.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly Up - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly Up.anim.meta b/Animations/Placeholders/UpFly Up.anim.meta deleted file mode 100644 index dfa12ff..0000000 --- a/Animations/Placeholders/UpFly Up.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8672a58cf3dba174fabfc1a6e917128b -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpFly.anim b/Animations/Placeholders/UpFly.anim deleted file mode 100644 index c52cb6f..0000000 --- a/Animations/Placeholders/UpFly.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpFly - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpFly.anim.meta b/Animations/Placeholders/UpFly.anim.meta deleted file mode 100644 index 89c991a..0000000 --- a/Animations/Placeholders/UpFly.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a3bba46aa8991b143b164fe8f22f6d79 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide L.anim b/Animations/Placeholders/UpGlide L.anim deleted file mode 100644 index c017347..0000000 --- a/Animations/Placeholders/UpGlide L.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpGlide L - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpGlide L.anim.meta b/Animations/Placeholders/UpGlide L.anim.meta deleted file mode 100644 index 30600e7..0000000 --- a/Animations/Placeholders/UpGlide L.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: baa36b7c17a4288439f4e20dd5e8e798 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide R.anim b/Animations/Placeholders/UpGlide R.anim deleted file mode 100644 index 0120d00..0000000 --- a/Animations/Placeholders/UpGlide R.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpGlide R - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpGlide R.anim.meta b/Animations/Placeholders/UpGlide R.anim.meta deleted file mode 100644 index f6f41e0..0000000 --- a/Animations/Placeholders/UpGlide R.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2c46f8b459a2e39489ad33e0c25e45e4 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/UpGlide.anim b/Animations/Placeholders/UpGlide.anim deleted file mode 100644 index 27e3ae8..0000000 --- a/Animations/Placeholders/UpGlide.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UpGlide - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/UpGlide.anim.meta b/Animations/Placeholders/UpGlide.anim.meta deleted file mode 100644 index 09f6888..0000000 --- a/Animations/Placeholders/UpGlide.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8355f35815429be48b4719939f7c92ae -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Placeholders/Walk Forward.anim b/Animations/Placeholders/Walk Forward.anim deleted file mode 100644 index 895022d..0000000 --- a/Animations/Placeholders/Walk Forward.anim +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Walk Forward - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: [] - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 1 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Animations/Placeholders/Walk Forward.anim.meta b/Animations/Placeholders/Walk Forward.anim.meta deleted file mode 100644 index 39c42e5..0000000 --- a/Animations/Placeholders/Walk Forward.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a59a6f188ee09e14d908a6c9e147efff -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 7400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Animations/Unka.overrideController b/Animations/Unka.overrideController index d5efee2..9e1e570 100644 --- a/Animations/Unka.overrideController +++ b/Animations/Unka.overrideController @@ -29,8 +29,6 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} m_OverrideClip: {fileID: 7400012, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} @@ -43,18 +41,9 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400048, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_OverrideClip: {fileID: 7400050, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} -<<<<<<< Updated upstream -======= - - m_OriginalClip: {fileID: 7400000, guid: 4831672f16dfe744d9678abaa1fb34d5, type: 2} - m_OverrideClip: {fileID: 7400000, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 51cb2bd50c3f1374bbe8b099d7fb522c, type: 2} - m_OverrideClip: {fileID: 7400002, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 0a91187913900d84ba38e9153afaebd7, type: 2} - m_OverrideClip: {fileID: 7400004, guid: 7e5a66b8143a22d439d97b8663da48a6, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 70997ae4164ecb646949949ea2ece781, type: 2} - m_OverrideClip: {fileID: 7400004, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: bc1a19ae29c61de40a0fae09acdb0251, type: 2} - m_OverrideClip: {fileID: 7400000, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: d2e2cdc6cc0c04b40827eb81f9d8409a, type: 2} - m_OverrideClip: {fileID: 7400008, guid: 7f0921a659d05b9439ac0555cdcc7cca, type: 3} ->>>>>>> Stashed changes + - m_OriginalClip: {fileID: 7400000, guid: c9b532f2b2c55b0409a5822a7aeffeb6, type: 2} + m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 6ea14cca7893ae448b5f6ecdcea029ee, type: 2} + m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: 705b9cfb18289ba4ca5016d9ac206754, type: 2} + m_OverrideClip: {fileID: 7400006, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} diff --git a/Documentation/flyCam.md b/Documentation/flyCam.md index 1f48727..a7cff54 100644 --- a/Documentation/flyCam.md +++ b/Documentation/flyCam.md @@ -18,8 +18,10 @@ This component manages the behaviour of the follow target. All parameters should The sensors section describes how the body senses waypoints that will define its flightpath: + * Waypoint Sensor - the [Sensor Tookit](https://bit.ly/SensorTookit) provided Waypoint Sensor, see below. + * Waypont Arrival Sensor - the [Sensor Tookit](https://bit.ly/SensorTookit) provided Waypoint Arrival Sensor, see below. * Waypoint Prefab - the waypoint prefab that sensors will be trying to detect - * Strategy - defines how the next candidate waypoints are selected. Note that waypoints can have a `Next Waypoint` defined. If it is defined it will take precedent over the list created by this strategy. Note also that the weight of candidate waypoints is used to make the final selection (see below), but the initial shortlist is created using this strategy. Strategies include `Furthest` (select the furthest detected waypoint), "Nearest" (select the nearest detected waypoint), "Random" select a random waypoint from the list detected. + * Strategy - defines how the next candidate waypoints are selected. Note that waypoints can have a `Next Waypoint` defined. If it is defined it will take precedent over the list created by this strategy. Note also that the weight of candidate waypoints is used to make the final selection (see below), but the initial shortlist is created using this strategy. Strategies include `Furhest` (select the furthest detected waypoint), "Nearest" (select the nearest detected waypoint), "Random" select a random waypoint from the list detected. * Randomness - this prevents the same path being taken every time. The lower this value the more mathematicaly certain the selection criteria is. A value of 0 will result in the same path each time, that is no randomness. @@ -36,6 +38,10 @@ The sensors section describes how the body senses waypoints that will define its ## Steering Rig (Child) +The `Camera Steering Rig` is an extension of their `Steering Rig` provided by [Sensor Toolkit](https://bit.ly/SensorTookit) which is required for this code to work. + +The critical parameters for this use case are described below, consult the Sensor Toolkit documentation for information on other parameters: + * Turn Force - (think "turning speed") the maximum torgque that can be applied to the rigid body, for most use cases a value between 0 and 1 seems to work well but you may get different results. * Move Force - (think "forward speed") The maximum forward force that can be applied to the rigid body. What this should be set to depends alot on the rigid bodies mass and drag. * Strafe Force - (think "horizontal/backward speed") the maximum sideways or backwards force that can be applied to the rigid body. What this should be set to depends alot on the rigid bodies mass and drag. @@ -62,12 +68,18 @@ If any of these paramaters are set to try you will be able to set the follwoing ### Height Management -If the `Maintain Height` property is set to true this section controls how height is managed for this body. +If the `Maintain Height` property is set to true this section controls how height is managed for this body. Note that Height is also managed by the Sensor Toolkit sensor array. The difference is that this section manages a preferred height while the sensor array ensures the body does not hit an obstacle. * Min Height - the minimum height that the body can normally fly at. If the sensor array has a sensor that defines a greater minimum height it will take precedence over this setting. * Max Height - The maximum height this body is normally allowed to fly at. * Optimal Height - the height that this body will prefer to fly at if possible. The body will tend towards this height unless there is an obstacle or waypoint that required it move to a different height. +## WaypointSensor (Child) + +The `Waypoint Sensor` is provided by [Sensor Toolkit](https://bit.ly/SensorTookit) which is required for this code to work. See the Sensor Toolkit for complete documentation here are some of the essential parameters for this use case: + + * `Sensor Range` the radius, in world units, within which waypoints will be detected. + # Follow CmM VCam1 This is a standard Cinemachine Virtual Camera. To use this camera your main camera will have had a `Cinemachine Brain` added. You can replace this with any Cinemachine camera you want. diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 378d38e..978dc4d 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -140,7 +140,7 @@ GameObject: - component: {fileID: 434040} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 0 + m_Layer: 31 m_Name: Large Creature Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -170,7 +170,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 1 + m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 diff --git a/Prefabs/Large Creature Waypoint.prefab.meta b/Prefabs/Large Creature Waypoint.prefab.meta index 284389d..e22ccae 100644 --- a/Prefabs/Large Creature Waypoint.prefab.meta +++ b/Prefabs/Large Creature Waypoint.prefab.meta @@ -1,7 +1,8 @@ fileFormatVersion: 2 guid: 4461efe13fc67904f8db2e5c8591aed0 -PrefabImporter: - externalObjects: {} +timeCreated: 1504618869 +licenseType: Store +NativeFormatImporter: userData: assetBundleName: assetBundleVariant: diff --git a/Prefabs/Waypoint Spawner.prefab b/Prefabs/Waypoint Spawner.prefab index 969c496..64373bf 100644 --- a/Prefabs/Waypoint Spawner.prefab +++ b/Prefabs/Waypoint Spawner.prefab @@ -43,14 +43,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1db34d609036b994ca87258eca785453, type: 3} m_Name: m_EditorClassIdentifier: - ToSpawn: {fileID: 146072, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - Number: 5 - SpawnInterval: 5 + ToSpawn: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} StartSpawnAmount: 2 + TotalNumber: 5 + SpawnInterval: 5 SizeX: 100 - SizeY: 10 SizeZ: 100 - ClearRadius: 1.8 + minHeight: 7 + maxHeight: 7 + AdjustToTerrainHeight: 1 + SpawnAboveWater: 1 ObstructingLayers: serializedVersion: 2 m_Bits: 1 + m_ShowAvailable: 0 + m_ShowUnavailable: 0 diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index f5d8c69..9d02004 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -141,7 +141,7 @@ GameObject: - component: {fileID: 5417428} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 0 + m_Layer: 31 m_Name: Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -187,7 +187,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 1 + m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 @@ -204,10 +204,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b1a3bf12463cfa542ae3f0b85a5baffc, type: 3} m_Name: m_EditorClassIdentifier: - ClearRadius: 1.8 weight: 0.5 reEnableWaitTime: 0 - NextWaypoint: {fileID: 0} --- !u!1 &173338 GameObject: m_ObjectHideFlags: 0 diff --git a/README.md b/README.md index fc77fda..3a70b27 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This is an Automated Explorer that will explore your scene for you. You can see Note, although the implementation can be made to work in internal spaces it has not been tested and we expect challenges in many such scenes. There is no pathfinding, only sensor movement, and so the current implementation is unable to identify an optimal path. However, it should be possible to use an algorithm such as A* to pathfind and then place waypoints along this path. In this situation the sensor navigation would then avoid obstacles in 3D space along the path. We would love a PR to implement this. +IMPORTANT: this code is dependent on the excellent [Sensor Toolkit](https://assetstore.unity.com/packages/tools/ai/sensor-toolkit-88036?aid=1101l866w) asset. It's cheap and excellent, we don't believe in reinventing the wheel, though we will accept PRs that remove this dependency. If you don't already have it please use the link above as it is our affiliate link, buy yourself an asset, buy us coffee. It also uses Cinemachine, but this is a free package from Unity so no worries there. + ## Features * Camera navigates in 3D space between waypoints @@ -18,6 +20,12 @@ Note, although the implementation can be made to work in internal spaces it has This is the easiest way of installing the code. Start with a standard Unity project and then follow the steps below. Note, using this method you cannot edit the sourcecode as packages are imported in read only mode. If you want to work with the code use the method described in the next section. +### Install Sensor Toolkit + + 1. Purchase and Install [Sensor Toolkit](https://assetstore.unity.com/packages/tools/ai/sensor-toolkit-88036?aid=1101l866w) (affiliate link) + 2. Note this code requires that the `SteeringRig.FixedUpdate` method in SensorToolkit is marked `protected virtual` which it is not out of the box. We've made a request to do this at https://forum.unity.com/threads/released-sensor-toolkit.468255/#post-7832232 but at the time of writing you will need to make this edit yourself. + 3. Add an Assembly Definition file called `Assets/SensorToolkit/micosmo.sensortoolkit` - the default file created will be enough, but note that more nuance will be needed if you plan to make a build. PRs welcome. + ### Install Automated Explorer 1. Select `Window -> Package Manager` @@ -43,6 +51,7 @@ This setup will work out of the box, but there are a great many options that all We are a big fan of enabling our users to improve the Automated Explorer Cam, so we would encourage you to use the source code, it's not much harder than using the latest release. 1. Create a Unity project within which to do your camera dev work + 2. Install Sensor toolike as described above 3. Add `Cinemachine` using the package manager 4. Fork the project on GitHub by clicking the icon in the top right 5. Clone the repo into your Unity projects Asset folder `git clone [YOUR_FORK_URL]` diff --git a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef index d307a59..fe813d2 100644 --- a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef +++ b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef @@ -3,12 +3,8 @@ "rootNamespace": "", "references": [ "wizardscode.ai.explorer", -<<<<<<< Updated upstream "Cinemachine", - "microsmo.sensortoolkit" -======= - "Cinemachine" ->>>>>>> Stashed changes + "micosmo.sensortoolkit" ], "includePlatforms": [ "Editor" diff --git a/Scripts/Runtime/Animation.meta b/Scripts/Runtime/Animation.meta deleted file mode 100644 index 529faed..0000000 --- a/Scripts/Runtime/Animation.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a4416828ff75eb94a8c256ccaf390aef -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index db4129f..c901588 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -4,13 +4,15 @@ using Random = UnityEngine.Random; using System.Linq; using UnityEngine.Serialization; +using WizardsCode.AI; namespace WizardsCode.Spawning { public class BoxAreaSpawner : MonoBehaviour { + //FIXME: generalize this so the spawner can be used for other items, not just WayPoints [SerializeField, Tooltip("The item we want to spawn using this spawner.")] - public GameObject ToSpawn; + public WayPoint ToSpawn; [SerializeField, Tooltip("The number of items to spawn at start.")] public int StartSpawnAmount; [SerializeField, Tooltip("The total number of items to have spawned. If an of the spawned items are destroyed then new ones will be spawned.")] @@ -29,12 +31,12 @@ public class BoxAreaSpawner : MonoBehaviour public float maxHeight = 7; [Header("Positioning")] - [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the terrain height at the spawn coordinates.")] - public bool AdjustToTerrainHeight = true; - [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be within the mx height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is true then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] - public bool SpawnAboveWater = true; - [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] - public float ClearRadius = 1.8f; + [SerializeField, Tooltip("If true then items spawned by this spawner will have their height adjusted to be under the max height above the terrain or mesh objects at the coordinates.")] + [FormerlySerializedAs("AdjustToTerrainHeight")] + public bool AdjustHeight = true; + [SerializeField, Tooltip("Set to true if you want to allow spawn points below water. If false then items spawned by this spawner will have their height adjusted to be under the max height of the water surface if appropriate at the spawn coordinates. This setting overrides the AdjustToTerrainHeight where approrpiate, that is if this is false then the spawn point will be above water regardless of the size height of the terrain and the AsjustToTerrainHeight setting.")] + [FormerlySerializedAs("SpawnAboveWater")] // changed 1/29 + public bool SpawnBelowWater = false; [SerializeField, Tooltip("The layers to look for obsructions when spawning.")] public LayerMask ObstructingLayers; @@ -46,6 +48,7 @@ public class BoxAreaSpawner : MonoBehaviour float spawnCountdown; GameObject[] spawned; + private int instanceCount; void Awake() { @@ -62,7 +65,18 @@ void Start() void OnEnable() { - StartCoroutine(SpawnRoutine()); + if (Application.isPlaying) + { + StartCoroutine(SpawnRoutine()); + } + } + + private void OnDisable() + { + if (Application.isPlaying) + { + StopAllCoroutines(); + } } IEnumerator SpawnRoutine() @@ -96,6 +110,9 @@ void Spawn() spawnCountdown = SpawnInterval; var nextSlot = nextAvailableSlot; if (nextSlot == -1) return; // No spawn slots available + + //OPTIMIZATION: Use a pool + WayPoint go = Instantiate(ToSpawn) as WayPoint; int nTrys = 0; Vector3 pos; @@ -107,22 +124,28 @@ void Spawn() Debug.LogWarning("Failed to find spawn location after 10 tries, aborting.", gameObject); return; } - pos = ChooseLocation(); - } while (LocationIsObstructed(pos)); + pos = ChooseLocation(go); + } while (LocationIsObstructed(pos, go)); - var newInst = Instantiate(ToSpawn, pos, transform.rotation) as GameObject; - newInst.transform.SetParent(transform.parent); - spawned[nextSlot] = newInst; + go.transform.SetPositionAndRotation(pos, transform.rotation); + go.name += instanceCount++; + go.transform.SetParent(transform.parent); + spawned[nextSlot] = go.gameObject; } - Vector3 ChooseLocation() + /// + /// Shoose a suitable location for an object to spawn. + /// + /// + /// + Vector3 ChooseLocation(WayPoint go) { Vector3 dimensions = new Vector3(SizeX / 2f, maxHeight - minHeight, SizeZ / 2f); - Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); + Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(0, 1f), Random.Range(-1f, 1f)); Vector3 pos = Vector3.Scale(dimensions, randNormalizedVector) + transform.position; - pos.y += minHeight; + pos.y += minHeight - transform.position.y; - pos = GetHeightAdjusted(pos); + pos = GetHeightAdjusted(pos, go); return pos; } @@ -130,61 +153,56 @@ Vector3 ChooseLocation() /// /// Adjust the height of a position in the terrain to allow for any obstructions on the terrain. /// - /// + /// The approximate position the object should be placed + /// The game object to place at the position /// - private Vector3 GetHeightAdjusted(Vector3 pos) + private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) { - if (!AdjustToTerrainHeight && !SpawnAboveWater) return pos; - - float clearance = (ClearRadius * 1.05f); + if (!AdjustHeight && SpawnBelowWater) return pos; - if (AdjustToTerrainHeight) + float clearance; + if (go == null) { - Terrain terrain = null; - if (Terrain.activeTerrains.Length == 1) - { - terrain = Terrain.activeTerrain; - } - else - { - terrain = Terrain.activeTerrains.OrderBy(x => - { - Vector3 terrainPosition = x.transform.position; - Vector3 terrainSize = x.terrainData.size * 0.5f; - Vector3 terrainCenter = new Vector3(terrainPosition.x + terrainSize.x, terrainPosition.y, terrainPosition.z + terrainSize.z); - return Vector3.SqrMagnitude(terrainCenter - pos); - }).First(); - } + clearance = 0.2f; + } + else + { + clearance = (go.ClearRadius * 1.05f); + } - if (terrain != null) - { - float terrainHeight = terrain.SampleHeight(pos); + //TODO: consider using just raycast, do we really need to measure terrain heigh. Consider that this will not take into account items onthe terrain, + RaycastHit hit; + float height = 0; + bool hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); + if (hasHit) + { + height = hit.distance; - if (pos.y < terrainHeight + clearance) + if (AdjustHeight) + { + if (pos.y < height + clearance) { - pos.y = terrain.transform.position.y + terrainHeight + clearance; - } else if (pos.y - terrainHeight > maxHeight) + pos.y = height + clearance; + } + else if (pos.y - height > maxHeight) { - pos.y = terrain.transform.position.y + Random.Range(terrainHeight + clearance, terrainHeight + maxHeight); + pos.y = height + Random.Range(height + clearance, height + maxHeight); + } + else + { + Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); } } - else - { - Debug.LogError($"No terrain found for {pos} while AdjustToTerrainheight is true."); - } - } - if (SpawnAboveWater) - { - RaycastHit hit; - if (Physics.Raycast(pos, Vector3.up, out hit, Mathf.Infinity)) + if (!SpawnBelowWater) { float waterHeight = hit.distance; if (pos.y < waterHeight + clearance) { pos.y = waterHeight + clearance; - } else if (pos.y - waterHeight > maxHeight) + } + else if (pos.y - waterHeight > maxHeight) { pos.y = waterHeight + Random.Range(clearance, maxHeight); } @@ -194,9 +212,9 @@ private Vector3 GetHeightAdjusted(Vector3 pos) return pos; } - bool LocationIsObstructed(Vector3 location) + bool LocationIsObstructed(Vector3 location, WayPoint go) { - return Physics.CheckSphere(location, ClearRadius, ObstructingLayers); + return Physics.CheckSphere(location, go.ClearRadius, ObstructingLayers); } public void OnDrawGizmosSelected() @@ -211,10 +229,13 @@ public void OnDrawGizmosSelected() // Red sphere marking the center of the box Gizmos.color = Color.red; - Gizmos.DrawSphere(GetHeightAdjusted(transform.position), Mathf.Max(0.2f, ClearRadius)); + Gizmos.DrawSphere(GetHeightAdjusted(transform.position, null), Mathf.Max(0.2f, 0.2f)); if (m_ShowAvailable || m_ShowUnavailable) { + //OPTIMIZATION: Use a cached sample object (See start of method as well) + WayPoint go = Instantiate(ToSpawn) as WayPoint; + float depth = SizeX / 2; float xInterval = Mathf.Max(0.3f, SizeX / 20); float height = maxHeight / 2; @@ -230,13 +251,13 @@ public void OnDrawGizmosSelected() { { Vector3 pos = transform.position + new Vector3(-width + x, -height + y, -depth + z); - pos = GetHeightAdjusted(pos); - if (m_ShowAvailable && !LocationIsObstructed(pos)) + pos = GetHeightAdjusted(pos, go); + if (m_ShowAvailable && !LocationIsObstructed(pos, go)) { Gizmos.color = Color.green; Gizmos.DrawSphere(pos, 0.2f); } - else if (m_ShowUnavailable && LocationIsObstructed(pos)) + else if (m_ShowUnavailable && LocationIsObstructed(pos, go)) { Gizmos.color = Color.red; Gizmos.DrawSphere(pos, 0.2f); @@ -245,6 +266,9 @@ public void OnDrawGizmosSelected() } } } + + //OPTIMIZATION: Use a cached sample object (See start of method as well) + DestroyImmediate(go); } } } diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 00d288a..3b047e1 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -1,10 +1,5 @@ using UnityEngine; -<<<<<<< Updated upstream using SensorToolkit; -using UnityEngine.Serialization; -======= -using System.Collections.Generic; ->>>>>>> Stashed changes #if PHOTOSESSION_PRESENT using Rowlan.PhotoSession; #endif @@ -17,43 +12,29 @@ public class MoveToWaypoint : MonoBehaviour enum SelectionStrategy { nearest, furthest, random }; [Header("Sensors")] -<<<<<<< Updated upstream [SerializeField, Tooltip("The sensor for detecting waypoints.")] - Sensor WaypointSensor; + RangeSensor m_WaypointSensor; [SerializeField, Tooltip("The sensor for detecting when the target waypoint has been reached.")] - Sensor WaypoinArrivalSensor; - [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] - WayPoint waypointPrefab; -======= + TriggerSensor m_WaypoinArrivalSensor; [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] WayPoint m_waypointPrefab; - [SerializeField, Tooltip("The range of the waypoint sensor this body has.")] - float m_sensorRange =200; - [SerializeField, Tooltip("The layers on which waypoints will be detected by this body")] - LayerMask m_detectsOnLayers = 1 << 0; // default ->>>>>>> Stashed changes [SerializeField, Tooltip("Strategy for selecting the next waypoint when one is not currently selected.")] - SelectionStrategy strategy = SelectionStrategy.nearest; + SelectionStrategy m_SelectionStrategy = SelectionStrategy.nearest; [SerializeField, Tooltip("Randomness in the selection of the next waypoint. The higher this value the more randomness there will be."), Range(0f, 1f)] -<<<<<<< Updated upstream - float randomness = 0.2f; + float m_SelectionRandomness = 0.2f; + /* [SerializeField, Tooltip("The radius that is used for the turning circle of the body. 0 means the body can turn on the spot. Note that a turning radius that is too close to the Waypoint Arrival sensor range will likely cause problems.")] [Range(0f, 100f)] - float turningRadius = 15; -======= - float m_SelectionRandomness = 0.2f; ->>>>>>> Stashed changes + float m_TurningRadius = 15; + */ [Header("Steering")] [SerializeField, Tooltip("The rig for steering towards the currently selected waypoint.")] - [FormerlySerializedAs("Steering")] // changed 1/23/22 - SteeringRig SteeringRig; + FlyingSteeringRig m_SteeringRig; [SerializeField, Tooltip("How long should the object be in the same place, if it has an existing waypoint destination, before it is assumed to be stuck. When stuck a new waypoint will be created a few meters away roughly behind the current position.")] - float stuckDuration = 0.5f; + float m_StuckDuration = 0.5f; [SerializeField, Tooltip("The tolerance to use when deciding if the item is stuck. If the object moves more than this distance in any direction in the `stuckDuration` then it will be considered to be moving.")] - float stuckTolerance = 0.05f; - [SerializeField, Tooltip("If set to true the sensor rig will be set to rotate towards the selected target waypoint.")] - bool faceTowardsTarget = false; + float m_StuckTolerance = 0.05f; [Header("Arrival Behaviours")] [SerializeField, Tooltip("If you have [Photo Session](https://github.com/TheWizardsCode/PhotoSession) and this setting is true then a new photo will be taken each time the target reaches a waypoint. " + @@ -71,11 +52,6 @@ enum SelectionStrategy { nearest, furthest, random }; Vector3 oldPosition = Vector3.zero; float timeToStuck; float sqrStuckTolerance; - - private WayPoint nextWaypoint; - private WayPoint lastWaypoint; - private Collider[] collidersCache; - private List detectedWaypoints = new List(); #if PHOTOSESSION_PRESENT PhotoSession photoSession; #endif @@ -84,18 +60,10 @@ private void Start() { if (m_RandomizeStartingPosition) { -<<<<<<< Updated upstream - WaypointSensor.Pulse(); - if (WaypointSensor.DetectedObjects.Count > 0) - { - WayPoint start = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); -======= - Pulse(); - - if (detectedWaypoints.Count > 0) + m_WaypointSensor.Pulse(); + if (m_WaypointSensor.DetectedObjects.Count > 0) { - WayPoint start = detectedWaypoints[Random.Range(0, detectedWaypoints.Count)].GetComponent(); ->>>>>>> Stashed changes + WayPoint start = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); if (start) { transform.position = start.transform.position; @@ -104,33 +72,17 @@ private void Start() } } - timeToStuck = stuckDuration; - sqrStuckTolerance = stuckTolerance * stuckTolerance; + timeToStuck = m_StuckDuration; + sqrStuckTolerance = m_StuckTolerance * m_StuckTolerance; #if PHOTOSESSION_PRESENT photoSession = GameObject.FindObjectOfType(); #endif } - /// - /// Scan for Waypoints withing the sensor range. Available waypoints - /// will be stored in `detectedWaypoints. - /// - private void Pulse() - { - WayPoint waypoint; - detectedWaypoints.Clear(); - //Optimization: use NonAlloc and manually managed cache size.s - collidersCache = Physics.OverlapSphere(transform.position, m_sensorRange, m_detectsOnLayers, QueryTriggerInteraction.Collide); - for (int i = 0; i < collidersCache.Length; i++) - { - waypoint = collidersCache[i].GetComponent(); - if (waypoint) - { - detectedWaypoints.Add(waypoint); - } - } - } + private WayPoint nextWaypoint; + private WayPoint lastWaypoint; + WayPoint currentWaypoint { get @@ -143,17 +95,9 @@ WayPoint currentWaypoint if (m_currentWaypoint != value) { m_currentWaypoint = value; - if (m_currentWaypoint != null) + if (currentWaypoint != null && m_SteeringRig != null) { - SteeringRig.IgnoreList.Clear(); - SteeringRig.IgnoreList.Add(m_currentWaypoint.gameObject); - SteeringRig.IgnoreList.Add(gameObject); - SteeringRig.DestinationTransform = m_currentWaypoint.transform; - - if (faceTowardsTarget) - { - SteeringRig.FaceTowardsTransform = m_currentWaypoint.transform; - } + m_SteeringRig.destination = currentWaypoint.transform; } } } @@ -169,7 +113,7 @@ bool IsStuck } else { oldPosition = transform.position; - timeToStuck = stuckDuration; + timeToStuck = m_StuckDuration; } return timeToStuck <= 0; @@ -182,31 +126,24 @@ void Update() { OnWaypointArrival(); - Vector3 pos = -transform.forward * Random.Range(SteeringRig.StoppingDistance * 2.5f, SteeringRig.StoppingDistance * 3.5f); + Vector3 pos = -transform.forward * Random.Range(2.5f, 3.5f); pos += transform.right * Random.Range(-0.5f, -0.5f); pos += transform.up * Random.Range(0.5f, 1f); - GameObject go = Instantiate(waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); + + GameObject go = Instantiate(m_waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); go.name = stuckWaypointName; currentWaypoint = go.GetComponent(); oldPosition = transform.position; - timeToStuck = stuckDuration; + timeToStuck = m_StuckDuration; -<<<<<<< Updated upstream - WaypointSensor.Pulse(); -======= - Pulse(); ->>>>>>> Stashed changes + m_WaypointSensor.Pulse(); } if (!currentWaypoint) { SelectNewWaypoint(); } -<<<<<<< Updated upstream - else if (WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) -======= - else if (m_SteeringRig.hasReachedDestination) ->>>>>>> Stashed changes + else if (m_WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) { OnWaypointArrival(); } @@ -235,11 +172,7 @@ private void OnWaypointArrival() { currentWaypoint.Disable(); } -<<<<<<< Updated upstream - WaypointSensor.Pulse(); -======= - Pulse(); ->>>>>>> Stashed changes + m_WaypointSensor.Pulse(); lastWaypoint = currentWaypoint; currentWaypoint = null; @@ -266,12 +199,6 @@ private void OnWaypointArrival() /// private void SelectNewWaypoint() { - if (m_SteeringRig.isGrounded) - { - Debug.Log("MoveToWayPoint does not support ground movement yet."); - return; - } - if (nextWaypoint != null) { currentWaypoint = nextWaypoint; @@ -285,12 +212,7 @@ private void SelectNewWaypoint() } else { -<<<<<<< Updated upstream - switch (strategy) -======= - Pulse(); switch (m_SelectionStrategy) ->>>>>>> Stashed changes { case SelectionStrategy.nearest: currentWaypoint = GetWeightedNearestFromPointWithComponent(transform.position); @@ -299,82 +221,51 @@ private void SelectNewWaypoint() currentWaypoint = GetWeightedFurthestFromPointWithComponent(transform.position); break; case SelectionStrategy.random: -<<<<<<< Updated upstream - if (WaypointSensor.DetectedObjects.Count > 0) - { - currentWaypoint = WaypointSensor.DetectedObjects[Random.Range(0, WaypointSensor.DetectedObjects.Count)].GetComponent(); -======= - if (detectedWaypoints.Count > 0) + if (m_WaypointSensor.DetectedObjects.Count > 0) { - currentWaypoint = detectedWaypoints[Random.Range(0, detectedWaypoints.Count)].GetComponent(); ->>>>>>> Stashed changes + currentWaypoint = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); } break; default: - Debug.LogError("Unknown selection strategy: " + strategy); + Debug.LogError("Unknown selection strategy: " + m_SelectionStrategy); break; } } } -<<<<<<< Updated upstream - if (currentWaypoint == null || turningRadius == 0) return; + if (currentWaypoint == null) return; + /* create a turning circle if the next waypoint will cause the body to flip Transform root = transform.root; Vector3 heading = currentWaypoint.transform.position - root.position; - float dot = Vector3.Dot(heading, root.forward); - if ( dot < 0.5) + float dot = Vector3.Dot(heading.normalized, root.forward.normalized); + if ( dot < 0.3) { nextWaypoint = currentWaypoint; - currentWaypoint = Instantiate(waypointPrefab); + currentWaypoint = Instantiate(m_waypointPrefab); currentWaypoint.name = $"Turning waypoint (heading to {nextWaypoint})."; - Vector3 leftRight = Vector3.zero; - if (Vector3.SignedAngle(currentWaypoint.transform.position, root.position, Vector3.up) > 0) { - leftRight = root.right; - } else - { - leftRight = -root.right; - } + currentWaypoint.reEnableWaitTime = 0; - Vector3 pos = transform.position + (leftRight * turningRadius) + (root.forward * turningRadius); + //TODO: Don't always turn right, decide the least obstructed path and go that way + Vector3 pos = transform.position + (root.right * m_TurningRadius) + (root.forward * m_TurningRadius) + (root.up * 2); //FIXME: this needs to be set at a height above the terrain as there is a danger that it will be set into a slope and be inacessible pos.y = root.position.y; currentWaypoint.transform.position = pos; -======= - if (currentWaypoint == null) return; - } - - // Returns a list of detected Waypoints ordered by their distance from the body. - public List DetectedObjectsOrderedByDistance - { - get - { - List detectedWaypointsOrderedByDistance = new List(); - detectedWaypointsOrderedByDistance.Clear(); - detectedWaypointsOrderedByDistance.AddRange(detectedWaypoints); - DistanceComparer comparer = new DistanceComparer(); - comparer.position = transform.position; - detectedWaypointsOrderedByDistance.Sort(comparer); - return detectedWaypointsOrderedByDistance; ->>>>>>> Stashed changes } + */ } private WayPoint GetWeightedFurthestFromPointWithComponent(Vector3 point) { WayPoint furthest = null; var furthestDistance = 0f; -<<<<<<< Updated upstream - var gos = WaypointSensor.DetectedObjectsOrderedByDistance; -======= - var gos = DetectedObjectsOrderedByDistance; ->>>>>>> Stashed changes + var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = waypoint.weight + Random.Range(0, randomness); + float weight = waypoint.weight + Random.Range(0, m_SelectionRandomness); var weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (furthest == null || weightedDistance > furthestDistance) { @@ -389,17 +280,13 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) { WayPoint nearest = null; var nearestDistance = 0f; -<<<<<<< Updated upstream - var gos = WaypointSensor.DetectedObjectsOrderedByDistance; -======= - var gos = DetectedObjectsOrderedByDistance; ->>>>>>> Stashed changes + var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); if (waypoint == null) { continue; } - float weight = 1.001f - (waypoint.weight + Random.Range(0, randomness)); + float weight = 1.001f - (waypoint.weight + Random.Range(0, m_SelectionRandomness)); float weightedDistance = Vector3.SqrMagnitude(waypoint.transform.position - point) * weight; if (nearest == null || weightedDistance < nearestDistance) @@ -410,30 +297,14 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) } return nearest; } -<<<<<<< Updated upstream -======= private void OnValidate() { if (m_SteeringRig == null) m_SteeringRig = GetComponentInChildren(); - } - } - public class DistanceComparer : IComparer - { - public Vector3 position; - public int Compare(WayPoint x, WayPoint y) - { - var d1 = Vector3.SqrMagnitude(x.transform.position - position); - var d2 = Vector3.SqrMagnitude(y.transform.position - position); - if (d1 < d2) { - return -1; - } else if (d1 > d2) { - return 1; - } else { - return 0; - } + if (m_WaypointSensor == null) m_WaypointSensor = GetComponentInChildren(); + + if (m_WaypoinArrivalSensor == null) m_WaypoinArrivalSensor = GetComponentInChildren(); } ->>>>>>> Stashed changes } } \ No newline at end of file diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index f977daf..91d78d3 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -36,11 +36,9 @@ public class FlyingSteeringRig : MonoBehaviour " If this is true the following settings will confine the height.")] bool m_MaintainHeight = true; [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + - " should be. The body will always try to get higher if it drops below this height.")] + " should be. This is used as a validation check to ensure the object is not going below" + + " the terrain or through a mesh obstacles in the scene.")] float m_MinHeight = 1.5f; - [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + - " automatically land.")] - float m_LandingHeight = 0.5f; [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + " should be. This is used as a validation check to ensure the object is not going too" + " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + @@ -126,46 +124,13 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } } - internal bool hasReachedDestination + private bool hasReachedDestination { get { return (rigidbody.transform.position - destination.position).magnitude <= m_ArrivalDistance; } } - - /// - /// Returns true if the body is currently on the ground. - /// - public bool isGrounded { - get - { - return height <= 0.01f; - } - } - - /// - /// Returns the current height of the body above the nearest obstacle below it. - /// - public float height { - get - { - //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame - - RaycastHit hit; - if (Physics.Raycast(rigidbody.position, Vector3.down, out hit, Mathf.Infinity)) - { - return hit.distance; - } else - { - Debug.LogError("The raycast to get body height didn't hit anything. Returning a height of infinity, but this likely shouldn't happen."); - return Mathf.Infinity; - } - } - } - - bool m_isLanding = false; - protected virtual void FixedUpdate() { if (destination == null) return; @@ -176,57 +141,23 @@ protected virtual void FixedUpdate() return; } - if (isGrounded) - { - GroundMovement(); - } - else - { - FlightPhysics(); - } - } - - /// - /// Cacluate movement of the body when on the ground. - /// - private void GroundMovement() - { - Vector3 moveDirection = Vector3.zero; - - // take off - moveDirection = new Vector3(0, 1, 1); - - // Add the forces - //rigidbody.transform.Translate(Vector3.Lerp(rigidbody.transform.position, rigidbody.transform.TransformDirection(moveDirection), Time.deltaTime)); - } - - /// - /// Calculates the forces to put on the body for the current conditions. - /// - private void FlightPhysics() - { Vector3 desiredDirection = (destination.position - rigidbody.transform.position); - Vector3 moveDirection = Vector3.zero; + Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) { moveDirection += desiredDirection.normalized; - } - else + } else { moveDirection += desiredDirection; } - - if (!m_isLanding) + + Vector3 repulsion = GetRepulsionDirection(); + if (repulsion.sqrMagnitude > 0.01f) { - Vector3 repulsion = GetRepulsionDirection(); - if (repulsion.sqrMagnitude > 0.01f) - { - moveDirection += repulsion.normalized; - } - else - { - moveDirection += repulsion * 100; - } + moveDirection += repulsion.normalized; + } else + { + moveDirection += repulsion * 100; } // Rotate towards the desired direction @@ -244,7 +175,7 @@ private void FlightPhysics() float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; rigidbody.AddTorque(rigidbody.transform.forward * -force); - SetAnimationParameters(); + SetAnimationParameters(moveDirection); // Forward force to add float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); @@ -253,75 +184,39 @@ private void FlightPhysics() // Vertical force to add float verticalDotMove = Vector3.Dot(Vector3.up, moveDirection.normalized); float verticalForce = 0; - if (verticalDotMove > 0) - { + if (verticalDotMove > 0) { verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); } // Add the forces - rigidbody.AddForce((forwardForce * moveDirection.normalized) + rigidbody.AddForce((forwardForce * moveDirection.normalized) + (verticalForce * rigidbody.transform.up)); // Don't go over maximum speed rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed); } - /// - /// Set the animation parameters for the current state - /// - void SetAnimationParameters() + void SetAnimationParameters(Vector3 moveDirection) { if (!m_Animator) return; - if (isGrounded) - { - SetGroundAnimationParameters(); - } - else - { - SetFlightAnimationParameters(); - } - } - - private void SetGroundAnimationParameters() - { - //OPTIMIZATION: Use hash not string - m_Animator.SetBool("isGrounded", true); - m_isLanding = false; - m_Animator.SetBool("land", false); - } - - private void SetFlightAnimationParameters() - { - float verticalVelocity = rigidbody.velocity.normalized.y; - //OPTIMIZATION: Use Hash not string - if (m_isLanding) - { - m_Animator.SetBool("land", true); - return; - } else - { - m_Animator.SetBool("land", false); - } - - m_Animator.SetBool("isGrounded", false); Quaternion q = rigidbody.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); - //float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); + float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); float pitch; if (pitchRad <= 0) // up { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxClimbAngle; - } - else + } else { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxDiveAngle; } - //float yaw = yawRad / 1.52f; + float yaw = yawRad / 1.52f; float roll = rollRad / 3.14f; float strafeVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.x; + float verticalVelocity = rigidbody.velocity.normalized.y; float forwardVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.z; bool glide = false; @@ -330,12 +225,12 @@ private void SetFlightAnimationParameters() glide = pitch > -0.2 && pitch < 0.2; } + //OPTIMIZATION: Use Hash not string m_Animator.SetFloat("yaw", strafeVelocity); if (pitch <= 0) // up { m_Animator.SetFloat("pitch", pitch); - } - else // down + } else // down { m_Animator.SetFloat("pitch", pitch); } diff --git a/Scripts/Runtime/WayPoint.cs b/Scripts/Runtime/WayPoint.cs index cf8c23e..4ef8670 100644 --- a/Scripts/Runtime/WayPoint.cs +++ b/Scripts/Runtime/WayPoint.cs @@ -13,9 +13,11 @@ namespace WizardsCode.AI /// public class WayPoint : MonoBehaviour { + [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] + public float ClearRadius = 1.8f; [SerializeField, Tooltip("The relative weight of this waypoint in terms of it's interest. A higher value will increase the chances of this waypoint being selected all other choice factors being equal."), Range(0.001f, 1f)] internal float weight = 0.5f; - [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will not be re-enabled.")] + [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will destroyed once visited.")] internal float reEnableWaitTime = 0; [SerializeField, Tooltip("If set the next waypoint selected will be the one set here, assuming that it is still present in the scene.")] public WayPoint NextWaypoint; @@ -70,6 +72,9 @@ public void Disable() if (reEnableWaitTime > 0) { timeToReEnable = Time.timeSinceLevelLoad + reEnableWaitTime; + } else + { + Destroy(this.gameObject); } } @@ -85,7 +90,7 @@ public void Enable() private void OnDrawGizmos() { Gizmos.color = Color.blue; - Gizmos.DrawSphere(transform.position, 0.2f); + Gizmos.DrawSphere(transform.position, ClearRadius); } } } \ No newline at end of file diff --git a/Scripts/Runtime/wizardscode.ai.explorer.asmdef b/Scripts/Runtime/wizardscode.ai.explorer.asmdef index 9f4de7a..b8fb5b5 100644 --- a/Scripts/Runtime/wizardscode.ai.explorer.asmdef +++ b/Scripts/Runtime/wizardscode.ai.explorer.asmdef @@ -2,12 +2,8 @@ "name": "wizardscode.ai.explorer", "rootNamespace": "", "references": [ -<<<<<<< Updated upstream "PhotoSession.Runtime", - "microsmo.sensortoolkit" -======= - "PhotoSession.Runtime" ->>>>>>> Stashed changes + "micosmo.sensortoolkit" ], "includePlatforms": [], "excludePlatforms": [], From 727dda965d157eac5f5bb01ffd22877e4a75d5ef Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 00:32:55 -0800 Subject: [PATCH 10/36] revert previous commit that was completely messed up. Redo removal of waypoint sensor code (take off not reinstated yet) --- Animations/DragonController.controller | 29 -- Prefabs/Large Creature Waypoint.prefab | 282 +------------ .../Waypoint with Floating Point Fix.prefab | 398 ------------------ ...ypoint with Floating Point Fix.prefab.meta | 8 - Prefabs/Waypoint.prefab | 284 ++----------- .../wizardscode.ai.explorer.editor.asmdef | 3 +- Scripts/Runtime/MoveToWaypoint.cs | 124 ++++-- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 2 +- .../Runtime/wizardscode.ai.explorer.asmdef | 3 +- 9 files changed, 128 insertions(+), 1005 deletions(-) delete mode 100644 Prefabs/Waypoint with Floating Point Fix.prefab delete mode 100644 Prefabs/Waypoint with Floating Point Fix.prefab.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 6ce4939..699179d 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -166,9 +166,6 @@ AnimatorStateMachine: - serializedVersion: 1 m_State: {fileID: 3062000143290070295} m_Position: {x: 470, y: 270, z: 0} - - serializedVersion: 1 - m_State: {fileID: -1651374198255606467} - m_Position: {x: 532.09485, y: -64.83923, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -204,32 +201,6 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1102 &-1651374198255606467 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Fly Hover - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: [] - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 978dc4d..4ffadec 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -1,134 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &105448 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 440904} - - component: {fileID: 3349790} - - component: {fileID: 13604396} - - component: {fileID: 2380250} - m_Layer: 0 - m_Name: Cylinder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &440904 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.44792253, y: 0.32641995, z: 0.44792253} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3349790 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!136 &13604396 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2380250 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 8caa672625832e74b8a4939c5f89ce08, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &106212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 460788} - m_Layer: 0 - m_Name: Mesh - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &460788 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 106212} - 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: - - {fileID: 440904} - - {fileID: 430804} - - {fileID: 423912} - m_Father: {fileID: 434040} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &146072 GameObject: m_ObjectHideFlags: 0 @@ -140,7 +11,7 @@ GameObject: - component: {fileID: 434040} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 31 + m_Layer: 0 m_Name: Large Creature Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -158,7 +29,7 @@ Transform: m_LocalPosition: {x: 0, y: 1.218, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 460788} + - {fileID: 4879797774331033280} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -191,102 +62,7 @@ MonoBehaviour: weight: 0.5 reEnableWaitTime: 0 NextWaypoint: {fileID: 0} ---- !u!1 &173338 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 423912} - - component: {fileID: 3344260} - - component: {fileID: 6520316} - - component: {fileID: 2354188} - m_Layer: 0 - m_Name: Cube 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &423912 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.306, z: 0} - m_LocalScale: {x: 0.515383, y: 0.16288914, z: 0.515383} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3344260 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6520316 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2354188 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &193702 +--- !u!1 &1072030564170204704 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -294,59 +70,45 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 430804} - - component: {fileID: 3361092} - - component: {fileID: 6583620} - - component: {fileID: 2347972} - m_Layer: 0 - m_Name: Cube + - component: {fileID: 4879797774331033280} + - component: {fileID: 4045462714422318277} + - component: {fileID: 3077099962748577212} + m_Layer: 31 + m_Name: Cylinder m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &430804 +--- !u!4 &4879797774331033280 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} + m_GameObject: {fileID: 1072030564170204704} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.349, z: 0} - m_LocalScale: {x: 0.515383, y: 0.17595918, z: 0.515383} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 1 + m_Father: {fileID: 434040} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3361092 +--- !u!33 &4045462714422318277 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6583620 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2347972 + m_GameObject: {fileID: 1072030564170204704} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3077099962748577212 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} + m_GameObject: {fileID: 1072030564170204704} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -356,10 +118,10 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 + m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -368,7 +130,7 @@ MeshRenderer: m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_ReceiveGI: 1 - m_PreserveUVs: 1 + m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 1 diff --git a/Prefabs/Waypoint with Floating Point Fix.prefab b/Prefabs/Waypoint with Floating Point Fix.prefab deleted file mode 100644 index 06960da..0000000 --- a/Prefabs/Waypoint with Floating Point Fix.prefab +++ /dev/null @@ -1,398 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &105448 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 440904} - - component: {fileID: 3349790} - - component: {fileID: 13604396} - - component: {fileID: 2380250} - m_Layer: 0 - m_Name: Cylinder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &440904 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.44792253, y: 0.32641995, z: 0.44792253} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3349790 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!136 &13604396 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2380250 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 8caa672625832e74b8a4939c5f89ce08, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &106212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 460788} - m_Layer: 0 - m_Name: Mesh - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &460788 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 106212} - 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: - - {fileID: 440904} - - {fileID: 430804} - - {fileID: 423912} - m_Father: {fileID: 434040} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &146072 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 434040} - - component: {fileID: 5417428} - - component: {fileID: 5192126769102148771} - - component: {fileID: 6907383477543755845} - m_Layer: 31 - m_Name: Waypoint with Floating Point Fix - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &434040 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 146072} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1.218, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 460788} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!54 &5417428 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 146072} - serializedVersion: 2 - m_Mass: 10 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!135 &5192126769102148771 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 146072} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.01 - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &6907383477543755845 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 146072} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b1a3bf12463cfa542ae3f0b85a5baffc, type: 3} - m_Name: - m_EditorClassIdentifier: - weight: 0.5 - reEnableWaitTime: 0 ---- !u!1 &173338 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 423912} - - component: {fileID: 3344260} - - component: {fileID: 6520316} - - component: {fileID: 2354188} - m_Layer: 0 - m_Name: Cube 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &423912 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.306, z: 0} - m_LocalScale: {x: 0.515383, y: 0.16288914, z: 0.515383} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3344260 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6520316 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2354188 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &193702 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 430804} - - component: {fileID: 3361092} - - component: {fileID: 6583620} - - component: {fileID: 2347972} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &430804 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.349, z: 0} - m_LocalScale: {x: 0.515383, y: 0.17595918, z: 0.515383} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3361092 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6583620 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2347972 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} diff --git a/Prefabs/Waypoint with Floating Point Fix.prefab.meta b/Prefabs/Waypoint with Floating Point Fix.prefab.meta deleted file mode 100644 index 4407f37..0000000 --- a/Prefabs/Waypoint with Floating Point Fix.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d3e55bc2543578442861c6802d15247b -timeCreated: 1504618869 -licenseType: Store -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index 9d02004..9fe505e 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -1,134 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &105448 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 440904} - - component: {fileID: 3349790} - - component: {fileID: 13604396} - - component: {fileID: 2380250} - m_Layer: 0 - m_Name: Cylinder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &440904 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.44792253, y: 0.32641995, z: 0.44792253} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3349790 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!136 &13604396 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2380250 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 105448} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 8caa672625832e74b8a4939c5f89ce08, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &106212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 460788} - m_Layer: 0 - m_Name: Mesh - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &460788 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 106212} - 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: - - {fileID: 440904} - - {fileID: 430804} - - {fileID: 423912} - m_Father: {fileID: 434040} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &146072 GameObject: m_ObjectHideFlags: 0 @@ -141,7 +12,7 @@ GameObject: - component: {fileID: 5417428} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 31 + m_Layer: 0 m_Name: Waypoint m_TagString: Untagged m_Icon: {fileID: 0} @@ -159,7 +30,7 @@ Transform: m_LocalPosition: {x: 0, y: 1.218, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 460788} + - {fileID: 4372954971884194727} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -204,104 +75,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b1a3bf12463cfa542ae3f0b85a5baffc, type: 3} m_Name: m_EditorClassIdentifier: + ClearRadius: 1.8 weight: 0.5 reEnableWaitTime: 0 ---- !u!1 &173338 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 423912} - - component: {fileID: 3344260} - - component: {fileID: 6520316} - - component: {fileID: 2354188} - m_Layer: 0 - m_Name: Cube 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &423912 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.306, z: 0} - m_LocalScale: {x: 0.515383, y: 0.16288914, z: 0.515383} - m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3344260 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6520316 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2354188 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173338} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &193702 + NextWaypoint: {fileID: 0} +--- !u!1 &1081804780503400520 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -309,59 +87,45 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 430804} - - component: {fileID: 3361092} - - component: {fileID: 6583620} - - component: {fileID: 2347972} - m_Layer: 0 - m_Name: Cube + - component: {fileID: 4372954971884194727} + - component: {fileID: 5819990210521936850} + - component: {fileID: 351145139052512555} + m_Layer: 31 + m_Name: Cylinder m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &430804 +--- !u!4 &4372954971884194727 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} + m_GameObject: {fileID: 1081804780503400520} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.349, z: 0} - m_LocalScale: {x: 0.515383, y: 0.17595918, z: 0.515383} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} m_Children: [] - m_Father: {fileID: 460788} - m_RootOrder: 1 + m_Father: {fileID: 434040} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3361092 +--- !u!33 &5819990210521936850 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6583620 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2347972 + m_GameObject: {fileID: 1081804780503400520} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &351145139052512555 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193702} + m_GameObject: {fileID: 1081804780503400520} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -371,10 +135,10 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RayTraceProcedural: 0 - m_RenderingLayerMask: 257 + m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: fc4afe0f20d07414d97777b1b7daaa7e, type: 2} + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -383,7 +147,7 @@ MeshRenderer: m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_ReceiveGI: 1 - m_PreserveUVs: 1 + m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 1 diff --git a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef index fe813d2..b460ca2 100644 --- a/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef +++ b/Scripts/Editor/wizardscode.ai.explorer.editor.asmdef @@ -3,8 +3,7 @@ "rootNamespace": "", "references": [ "wizardscode.ai.explorer", - "Cinemachine", - "micosmo.sensortoolkit" + "Cinemachine" ], "includePlatforms": [ "Editor" diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 3b047e1..335c67f 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -1,5 +1,5 @@ using UnityEngine; -using SensorToolkit; +using System.Collections.Generic; #if PHOTOSESSION_PRESENT using Rowlan.PhotoSession; #endif @@ -12,21 +12,16 @@ public class MoveToWaypoint : MonoBehaviour enum SelectionStrategy { nearest, furthest, random }; [Header("Sensors")] - [SerializeField, Tooltip("The sensor for detecting waypoints.")] - RangeSensor m_WaypointSensor; - [SerializeField, Tooltip("The sensor for detecting when the target waypoint has been reached.")] - TriggerSensor m_WaypoinArrivalSensor; [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] WayPoint m_waypointPrefab; + [SerializeField, Tooltip("The range of the waypoint sensor this body has.")] + float m_sensorRange = 200; + [SerializeField, Tooltip("The layers on which waypoints will be detected by this body")] + LayerMask m_detectsOnLayers = 1 << 0; // default [SerializeField, Tooltip("Strategy for selecting the next waypoint when one is not currently selected.")] SelectionStrategy m_SelectionStrategy = SelectionStrategy.nearest; [SerializeField, Tooltip("Randomness in the selection of the next waypoint. The higher this value the more randomness there will be."), Range(0f, 1f)] float m_SelectionRandomness = 0.2f; - /* - [SerializeField, Tooltip("The radius that is used for the turning circle of the body. 0 means the body can turn on the spot. Note that a turning radius that is too close to the Waypoint Arrival sensor range will likely cause problems.")] - [Range(0f, 100f)] - float m_TurningRadius = 15; - */ [Header("Steering")] [SerializeField, Tooltip("The rig for steering towards the currently selected waypoint.")] @@ -52,6 +47,10 @@ enum SelectionStrategy { nearest, furthest, random }; Vector3 oldPosition = Vector3.zero; float timeToStuck; float sqrStuckTolerance; + List m_DetectedWayPoints = new List(); + + private WayPoint nextWaypoint; + private WayPoint lastWaypoint; #if PHOTOSESSION_PRESENT PhotoSession photoSession; #endif @@ -60,10 +59,10 @@ private void Start() { if (m_RandomizeStartingPosition) { - m_WaypointSensor.Pulse(); - if (m_WaypointSensor.DetectedObjects.Count > 0) + Scan(); + if (m_DetectedWayPoints.Count > 0) { - WayPoint start = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); + WayPoint start = m_DetectedWayPoints[Random.Range(0, m_DetectedWayPoints.Count)].GetComponent(); if (start) { transform.position = start.transform.position; @@ -80,9 +79,6 @@ private void Start() #endif } - private WayPoint nextWaypoint; - private WayPoint lastWaypoint; - WayPoint currentWaypoint { get @@ -110,7 +106,8 @@ bool IsStuck if (Vector3.SqrMagnitude(oldPosition - transform.position) < sqrStuckTolerance) { timeToStuck -= Time.deltaTime; - } else + } + else { oldPosition = transform.position; timeToStuck = m_StuckDuration; @@ -120,6 +117,27 @@ bool IsStuck } } + /// + /// Scan the sensor area for Waypoints. + /// + void Scan() + { + //Optimization: Only scan after a period of time has elapsed since the last scan + //Optimization: Scan close by more frequently than at the full range + WayPoint waypoint; + m_DetectedWayPoints.Clear(); + //Optimization: use NonAlloc and manually managed cache size.s + Collider[] colliders = Physics.OverlapSphere(transform.position, m_sensorRange, m_detectsOnLayers, QueryTriggerInteraction.Collide); + for (int i = 0; i < colliders.Length; i++) + { + waypoint = colliders[i].GetComponent(); + if (waypoint) + { + m_DetectedWayPoints.Add(waypoint); + } + } + } + void Update() { if (currentWaypoint && IsStuck) @@ -129,21 +147,22 @@ void Update() Vector3 pos = -transform.forward * Random.Range(2.5f, 3.5f); pos += transform.right * Random.Range(-0.5f, -0.5f); pos += transform.up * Random.Range(0.5f, 1f); - + GameObject go = Instantiate(m_waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); go.name = stuckWaypointName; currentWaypoint = go.GetComponent(); oldPosition = transform.position; timeToStuck = m_StuckDuration; - m_WaypointSensor.Pulse(); + m_DetectedWayPoints.Add(currentWaypoint); } if (!currentWaypoint) { + Scan(); SelectNewWaypoint(); - } - else if (m_WaypoinArrivalSensor.IsDetected(currentWaypoint.gameObject)) + } + else if (m_SteeringRig.hasReachedDestination) { OnWaypointArrival(); } @@ -172,7 +191,6 @@ private void OnWaypointArrival() { currentWaypoint.Disable(); } - m_WaypointSensor.Pulse(); lastWaypoint = currentWaypoint; currentWaypoint = null; @@ -221,9 +239,9 @@ private void SelectNewWaypoint() currentWaypoint = GetWeightedFurthestFromPointWithComponent(transform.position); break; case SelectionStrategy.random: - if (m_WaypointSensor.DetectedObjects.Count > 0) + if (m_DetectedWayPoints.Count > 0) { - currentWaypoint = m_WaypointSensor.DetectedObjects[Random.Range(0, m_WaypointSensor.DetectedObjects.Count)].GetComponent(); + currentWaypoint = m_DetectedWayPoints[Random.Range(0, m_DetectedWayPoints.Count)].GetComponent(); } break; default: @@ -234,32 +252,30 @@ private void SelectNewWaypoint() } if (currentWaypoint == null) return; + } - /* create a turning circle if the next waypoint will cause the body to flip - Transform root = transform.root; - Vector3 heading = currentWaypoint.transform.position - root.position; - float dot = Vector3.Dot(heading.normalized, root.forward.normalized); - if ( dot < 0.3) + /// + /// Returns a list of detected Waypoints ordered by their distance from the body. + /// + public List DetectedObjectsOrderedByDistance + { + get { - nextWaypoint = currentWaypoint; - currentWaypoint = Instantiate(m_waypointPrefab); - currentWaypoint.name = $"Turning waypoint (heading to {nextWaypoint})."; - currentWaypoint.reEnableWaitTime = 0; - - //TODO: Don't always turn right, decide the least obstructed path and go that way - Vector3 pos = transform.position + (root.right * m_TurningRadius) + (root.forward * m_TurningRadius) + (root.up * 2); - //FIXME: this needs to be set at a height above the terrain as there is a danger that it will be set into a slope and be inacessible - pos.y = root.position.y; - currentWaypoint.transform.position = pos; + List detectedWaypointsOrderedByDistance = new List(); + detectedWaypointsOrderedByDistance.Clear(); + detectedWaypointsOrderedByDistance.AddRange(m_DetectedWayPoints); + DistanceComparer comparer = new DistanceComparer(); + comparer.position = transform.position; + detectedWaypointsOrderedByDistance.Sort(comparer); + return detectedWaypointsOrderedByDistance; } - */ } private WayPoint GetWeightedFurthestFromPointWithComponent(Vector3 point) { WayPoint furthest = null; var furthestDistance = 0f; - var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; + var gos = DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); @@ -280,7 +296,7 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) { WayPoint nearest = null; var nearestDistance = 0f; - var gos = m_WaypointSensor.DetectedObjectsOrderedByDistance; + var gos = DetectedObjectsOrderedByDistance; for (int i = 0; i < gos.Count; i++) { WayPoint waypoint = gos[i].GetComponent(); @@ -301,10 +317,28 @@ private WayPoint GetWeightedNearestFromPointWithComponent(Vector3 point) private void OnValidate() { if (m_SteeringRig == null) m_SteeringRig = GetComponentInChildren(); + } + } - if (m_WaypointSensor == null) m_WaypointSensor = GetComponentInChildren(); - - if (m_WaypoinArrivalSensor == null) m_WaypoinArrivalSensor = GetComponentInChildren(); + public class DistanceComparer : IComparer + { + public Vector3 position; + public int Compare(WayPoint x, WayPoint y) + { + var d1 = Vector3.SqrMagnitude(x.transform.position - position); + var d2 = Vector3.SqrMagnitude(y.transform.position - position); + if (d1 < d2) + { + return -1; + } + else if (d1 > d2) + { + return 1; + } + else + { + return 0; + } } } } \ No newline at end of file diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 91d78d3..0e7732a 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -124,7 +124,7 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } } - private bool hasReachedDestination + internal bool hasReachedDestination { get { diff --git a/Scripts/Runtime/wizardscode.ai.explorer.asmdef b/Scripts/Runtime/wizardscode.ai.explorer.asmdef index b8fb5b5..2223341 100644 --- a/Scripts/Runtime/wizardscode.ai.explorer.asmdef +++ b/Scripts/Runtime/wizardscode.ai.explorer.asmdef @@ -2,8 +2,7 @@ "name": "wizardscode.ai.explorer", "rootNamespace": "", "references": [ - "PhotoSession.Runtime", - "micosmo.sensortoolkit" + "PhotoSession.Runtime" ], "includePlatforms": [], "excludePlatforms": [], From 52eb05d30b3a80af476fe0e810d94d05ca0bda0a Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 00:45:20 -0800 Subject: [PATCH 11/36] Ensure the test scene works with the flying camera setup --- Prefabs/Camera Follow Target.prefab | 1310 +---------------- Prefabs/Waypoint.prefab | 19 +- Scenes/Mesh Scene.unity | 96 +- Scenes/Terrain Scene.unity | 1027 ------------- Scenes/Terrain Scene.unity.meta | 7 - Scripts/Runtime/Steering/FlyingSteeringRig.cs | 7 + 6 files changed, 115 insertions(+), 2351 deletions(-) delete mode 100644 Scenes/Terrain Scene.unity delete mode 100644 Scenes/Terrain Scene.unity.meta diff --git a/Prefabs/Camera Follow Target.prefab b/Prefabs/Camera Follow Target.prefab index c9a7bf6..dd670df 100644 --- a/Prefabs/Camera Follow Target.prefab +++ b/Prefabs/Camera Follow Target.prefab @@ -1,1185 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &109958 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 497084} - - component: {fileID: 11410988} - m_Layer: 0 - m_Name: Ray 9 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &497084 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 109958} - m_LocalRotation: {x: -0.3535529, y: 0.35355347, z: -0.14644642, w: 0.8535536} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 9 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11410988 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 109958} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &112544 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 467240} - - component: {fileID: 11467820} - m_Layer: 0 - m_Name: Down - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &467240 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 112544} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11467820 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 112544} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 2 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &121506 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 461314} - - component: {fileID: 11491204} - m_Layer: 0 - m_Name: Ray 10 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &461314 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 121506} - m_LocalRotation: {x: -0.38268292, y: 0, z: 0, w: 0.9238798} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 10 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11491204 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 121506} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &134770 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 405898} - - component: {fileID: 11465636} - m_Layer: 0 - m_Name: Ray 2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &405898 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 134770} - m_LocalRotation: {x: 0, y: 1, z: 0, w: -0.00000016292068} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11465636 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 134770} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &140438 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 476970} - - component: {fileID: 11480012} - m_Layer: 0 - m_Name: Down Forward Right - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &476970 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 140438} - m_LocalRotation: {x: 0.35355297, y: -0.35355344, z: -0.1464464, w: 0.85355365} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 13 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11480012 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 140438} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 5 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &148566 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 456120} - - component: {fileID: 11456762} - m_Layer: 0 - m_Name: Ray 3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &456120 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 148566} - m_LocalRotation: {x: 0, y: 0.7071066, z: 0, w: -0.70710695} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11456762 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 148566} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &149280 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 403102} - - component: {fileID: 11491162} - m_Layer: 0 - m_Name: Ray - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &403102 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 149280} - 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: 498066} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11491162 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 149280} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &152168 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 428666} - - component: {fileID: 11410848} - m_Layer: 0 - m_Name: Ray 4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &428666 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 152168} - m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071067} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11410848 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 152168} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &167088 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 439416} - - component: {fileID: 11471632} - m_Layer: 0 - m_Name: Ray 6 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &439416 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 167088} - m_LocalRotation: {x: 0, y: 0.38268346, z: 0, w: 0.9238795} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11471632 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 167088} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &168060 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 462678} - - component: {fileID: 11443208} - m_Layer: 0 - m_Name: Ray 8 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &462678 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 168060} - m_LocalRotation: {x: -0.3535529, y: -0.35355347, z: 0.14644642, w: 0.8535536} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11443208 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 168060} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &171068 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 449576} - - component: {fileID: 11420432} - m_Layer: 0 - m_Name: Ray 7 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &449576 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 171068} - m_LocalRotation: {x: 0, y: -0.38268346, z: 0, w: 0.9238795} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11420432 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 171068} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &173996 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 497124} - - component: {fileID: 11477234} - m_Layer: 0 - m_Name: Down Back - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &497124 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173996} - m_LocalRotation: {x: 0.35355297, y: 0.35355344, z: 0.1464464, w: 0.85355365} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 12 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11477234 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 173996} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 5 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &174424 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 431162} - - component: {fileID: 11485136} - m_Layer: 0 - m_Name: WaypointSensor - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &431162 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 174424} - 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: 481132} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11485136 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 174424} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3fd1782782c33a144aa3b0d575bb80ea, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - DetectionMode: 0 - RequiresLineOfSight: 0 - BlocksLineOfSight: - serializedVersion: 2 - m_Bits: 0 - TestLOSTargetsOnly: 0 - NumberOfRays: 1 - MinimumVisibility: 0.5 - SensorRange: 200 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 2147483648 - SensorUpdateMode: 0 - CheckInterval: 1 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 ---- !u!1 &180422 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 434448} - - component: {fileID: 11419296} - - component: {fileID: 13552164} - - component: {fileID: 858816307} - m_Layer: 2 - m_Name: WaypointArrivalSensor - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &434448 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 180422} - 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: 481132} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11419296 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 180422} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e841c6eddfb006049bd02ce632bb1417, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - DetectionMode: 0 - RequiresLineOfSight: 0 - BlocksLineOfSight: - serializedVersion: 2 - m_Bits: 0 - TestLOSTargetsOnly: 0 - NumberOfRays: 1 - MinimumVisibility: 0.5 - LineOfSightUpdateMode: 0 - CheckLineOfSightInterval: 1 ---- !u!135 &13552164 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 180422} - m_Material: {fileID: 0} - m_IsTrigger: 1 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 1.6922585 - m_Center: {x: 0, y: 0, z: 0} ---- !u!54 &858816307 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 180422} - 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!1 &184346 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 498066} - - component: {fileID: 3194173746643593969} - m_Layer: 0 - m_Name: SteeringRig - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &498066 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 184346} - 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: - - {fileID: 403102} - - {fileID: 404114} - - {fileID: 405898} - - {fileID: 456120} - - {fileID: 428666} - - {fileID: 467240} - - {fileID: 439416} - - {fileID: 449576} - - {fileID: 462678} - - {fileID: 497084} - - {fileID: 461314} - - {fileID: 498480} - - {fileID: 497124} - - {fileID: 476970} - m_Father: {fileID: 481132} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &3194173746643593969 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 184346} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9b2d1f7c80dcdd648b0afb4e5d33fa69, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - AvoidanceSensitivity: 1 - MaxAvoidanceLength: 2 - YAxis: 1 - RotateTowardsTarget: 1 - RB: {fileID: 5401098} - TurnForce: 3 - MoveForce: 35 - StrafeForce: 10 - TurnSpeed: 0 - MoveSpeed: 0 - StrafeSpeed: 0 - StoppingDistance: 1 - DestinationTransform: {fileID: 0} - FaceTowardsTransform: {fileID: 0} - m_MaintainHeight: 0 - minHeight: 1.5 - maxHeight: 2 - optimalHeight: 2 - m_RandomizeSpeed: 0 - m_Animator: {fileID: 0} - m_LegacyAnimation: {fileID: 0} - m_RandomizeX: 1 - m_RandomizeY: 1 - m_RandomizeZ: 1 - m_RandomizationFrequency: 3 ---- !u!1 &184980 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 498480} - - component: {fileID: 11446348} - m_Layer: 0 - m_Name: Down Back Right - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &498480 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 184980} - m_LocalRotation: {x: 0.38268292, y: 0, z: 0, w: 0.9238798} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 11 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11446348 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 184980} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} - m_Name: - m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 5 - Radius: 0 - ObstructedByLayers: - serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] --- !u!1 &189694 GameObject: m_ObjectHideFlags: 0 @@ -1190,8 +10,9 @@ GameObject: m_Component: - component: {fileID: 481132} - component: {fileID: 5401098} - - component: {fileID: 1513489596} - component: {fileID: 1159833090} + - component: {fileID: 1513489596} + - component: {fileID: 1365091131743649090} m_Layer: 0 m_Name: Camera Follow Target m_TagString: Untagged @@ -1211,9 +32,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 3373821529879445102} - - {fileID: 498066} - - {fileID: 434448} - - {fileID: 431162} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1233,29 +51,6 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 ---- !u!114 &1513489596 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 189694} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2c3975f20feceb04caeef64f7f0f2af7, type: 3} - m_Name: - m_EditorClassIdentifier: - WaypointSensor: {fileID: 11485136} - WaypoinArrivalSensor: {fileID: 11419296} - strategy: 2 - randomness: 0.2 - waypointPrefab: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, - type: 3} - Steering: {fileID: 3194173746643593969} - stuckDuration: 0.5 - stuckTolerance: 0.005 - m_TakePhotoOnArrival: 1 - m_RandomizeStartingPosition: 1 --- !u!135 &1159833090 SphereCollider: m_ObjectHideFlags: 0 @@ -1263,84 +58,67 @@ SphereCollider: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 189694} - m_Material: {fileID: 13400000, guid: 03c2be51a8473fe4a85e4aa5c31ee1ca, type: 2} + m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.05 m_Center: {x: 0, y: 0, z: 0} ---- !u!1 &193910 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 404114} - - component: {fileID: 11434616} - m_Layer: 0 - m_Name: Ray 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &404114 -Transform: +--- !u!114 &1513489596 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193910} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071067} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 498066} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &11434616 + m_GameObject: {fileID: 189694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2c3975f20feceb04caeef64f7f0f2af7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_waypointPrefab: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, + type: 3} + m_sensorRange: 200 + m_detectsOnLayers: + serializedVersion: 2 + m_Bits: 1 + m_SelectionStrategy: 0 + m_SelectionRandomness: 0.2 + m_SteeringRig: {fileID: 1365091131743649090} + m_StuckDuration: 0.5 + m_StuckTolerance: 0.05 + m_TakePhotoOnArrival: 0 + m_RandomizeStartingPosition: 1 +--- !u!114 &1365091131743649090 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 193910} + m_GameObject: {fileID: 189694} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4eef69e252fee6848bdd23e5429abac6, type: 3} + m_Script: {fileID: 11500000, guid: b4b518057b1f88040bff8e428a6b028d, type: 3} m_Name: m_EditorClassIdentifier: - IgnoreList: [] - EnableTagFilter: 0 - AllowedTags: [] - OnDetected: - m_PersistentCalls: - m_Calls: [] - OnLostDetection: - m_PersistentCalls: - m_Calls: [] - Length: 10 - Radius: 0 - ObstructedByLayers: + rigidbody: {fileID: 5401098} + m_ArrivalDistance: 1 + m_MaxTorque: 50 + m_MaxStrafeForce: 300 + m_MaxVerticalForce: 400 + m_MaxForwardForce: 800 + maxSpeed: 8 + m_MaxAvoidanceLength: 1.5 + m_AvoidanceLayers: serializedVersion: 2 - m_Bits: 1 - DetectsOnLayers: - serializedVersion: 2 - m_Bits: 17 - DetectionMode: 0 - Direction: {x: 0, y: 0, z: 1} - WorldSpace: 0 - SensorUpdateMode: 0 - InitialBufferSize: 20 - DynamicallyIncreaseBufferSize: 1 - OnObstruction: - m_PersistentCalls: - m_Calls: [] - OnClear: - m_PersistentCalls: - m_Calls: [] + m_Bits: 0 + m_MaintainHeight: 1 + m_MinHeight: 1.5 + m_MaxHeight: 10 + m_OptimalHeight: 2 + m_MaxClimbAngle: 35 + m_MaxDiveAngle: 75 + m_Animator: {fileID: 0} --- !u!1 &8301658394381504256 GameObject: m_ObjectHideFlags: 0 diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index 9fe505e..f0e8810 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -9,7 +9,6 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 434040} - - component: {fileID: 5417428} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} m_Layer: 0 @@ -34,22 +33,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!54 &5417428 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 146072} - serializedVersion: 2 - m_Mass: 10 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 --- !u!135 &5192126769102148771 SphereCollider: m_ObjectHideFlags: 0 @@ -58,7 +41,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 diff --git a/Scenes/Mesh Scene.unity b/Scenes/Mesh Scene.unity index 01e4ee9..136cafb 100644 --- a/Scenes/Mesh Scene.unity +++ b/Scenes/Mesh Scene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -505,7 +505,8 @@ Transform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &199054558 stripped Transform: - m_CorrespondingSourceObject: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + m_CorrespondingSourceObject: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} m_PrefabInstance: {fileID: 636334002} m_PrefabAsset: {fileID: 0} --- !u!1 &373465172 @@ -668,59 +669,73 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 1817917201698718570, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698718570, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_Name value: Waypoint Spawner objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalScale.y value: 1.5 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalPosition.y value: 5 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} + - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} propertyPath: SizeY value: 3 objectReference: {fileID: 0} @@ -828,59 +843,73 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_RootOrder value: 3 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalPosition.x value: 0.69257677 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalPosition.y value: 1.8 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalPosition.z value: 1.8762562 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalRotation.w value: -0.17588617 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalRotation.y value: 0.9844105 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalRotation.z value: -1e-45 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_Follow value: objectReference: {fileID: 1232492977} - - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_LookAt value: objectReference: {fileID: 1232492977} - - target: {fileID: 7970667151623748437, guid: 4157d46c891d60947a292698863e54df, type: 3} + - target: {fileID: 7970667151623748437, guid: 4157d46c891d60947a292698863e54df, + type: 3} propertyPath: m_Name value: Follow CM vcam1 objectReference: {fileID: 0} @@ -1076,7 +1105,8 @@ Transform: m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!4 &1232492977 stripped Transform: - m_CorrespondingSourceObject: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + m_CorrespondingSourceObject: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, + type: 3} m_PrefabInstance: {fileID: 626561146} m_PrefabAsset: {fileID: 0} --- !u!1 &1270574473 @@ -1294,7 +1324,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} propertyPath: m_LocalPosition.y - value: 1.218 + value: 19 objectReference: {fileID: 0} - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} propertyPath: m_LocalPosition.z @@ -1473,7 +1503,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} propertyPath: m_LocalPosition.y - value: 1.218 + value: 17.21 objectReference: {fileID: 0} - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} propertyPath: m_LocalPosition.z diff --git a/Scenes/Terrain Scene.unity b/Scenes/Terrain Scene.unity deleted file mode 100644 index b1f4f1e..0000000 --- a/Scenes/Terrain Scene.unity +++ /dev/null @@ -1,1027 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1001 &997132 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 189694, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_Name - value: Camera Follow Target - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalPosition.x - value: 138.9 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalPosition.y - value: 62.8 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} ---- !u!4 &1516906 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} - m_PrefabInstance: {fileID: 997132} - m_PrefabAsset: {fileID: 0} ---- !u!1 &202775237 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 202775238} - - component: {fileID: 202775241} - - component: {fileID: 202775240} - - component: {fileID: 202775239} - - component: {fileID: 202775242} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &202775238 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 202775237} - m_LocalRotation: {x: 1e-45, y: 0.707107, z: -1e-45, w: 0.70710665} - m_LocalPosition: {x: 136.9, y: 62.8, z: 0.0000009536743} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &202775239 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 202775237} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} - m_Name: - m_EditorClassIdentifier: - volumeTrigger: {fileID: 202775238} - volumeLayer: - serializedVersion: 2 - m_Bits: 256 - stopNaNPropagation: 1 - finalBlitToCameraTarget: 0 - antialiasingMode: 2 - temporalAntialiasing: - jitterSpread: 0.75 - sharpness: 0.25 - stationaryBlending: 0.95 - motionBlending: 0.85 - subpixelMorphologicalAntialiasing: - quality: 2 - fastApproximateAntialiasing: - fastMode: 0 - keepAlpha: 0 - fog: - enabled: 1 - excludeSkybox: 1 - debugLayer: - lightMeter: - width: 512 - height: 256 - showCurves: 1 - histogram: - width: 512 - height: 256 - channel: 3 - waveform: - exposure: 0.12 - height: 256 - vectorscope: - size: 256 - exposure: 0.12 - overlaySettings: - linearDepth: 0 - motionColorIntensity: 4 - motionGridSize: 64 - colorBlindnessType: 0 - colorBlindnessStrength: 1 - m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} - m_ShowToolkit: 0 - m_ShowCustomSorter: 0 - breakBeforeColorGrading: 0 - m_BeforeTransparentBundles: [] - m_BeforeStackBundles: [] - m_AfterStackBundles: [] ---- !u!81 &202775240 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 202775237} - m_Enabled: 1 ---- !u!20 &202775241 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 202775237} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0.6762638, g: 0.70359784, b: 0.8584906, a: 0} - m_projectionMatrixMode: 2 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 32.96973 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.1 - far clip plane: 5000 - field of view: 40 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!114 &202775242 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 202775237} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowDebugText: 0 - m_ShowCameraFrustum: 1 - m_IgnoreTimeScale: 0 - m_WorldUpOverride: {fileID: 0} - m_UpdateMethod: 2 - m_BlendUpdateMethod: 1 - m_DefaultBlend: - m_Style: 1 - m_Time: 2 - m_CustomCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - m_CustomBlends: {fileID: 0} - m_CameraCutEvent: - m_PersistentCalls: - m_Calls: [] - m_CameraActivatedEvent: - m_PersistentCalls: - m_Calls: [] ---- !u!1001 &291060662 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalPosition.x - value: 136.9 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalPosition.y - value: 62.8 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalPosition.z - value: 0.0000009536743 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalRotation.w - value: 0.70710665 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalRotation.x - value: 1e-45 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalRotation.y - value: 0.707107 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalRotation.z - value: -1e-45 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_Follow - value: - objectReference: {fileID: 1516906} - - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_LookAt - value: - objectReference: {fileID: 1516906} - - target: {fileID: 7970667151623748437, guid: 4157d46c891d60947a292698863e54df, type: 3} - propertyPath: m_Name - value: Follow CM vcam1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4157d46c891d60947a292698863e54df, type: 3} ---- !u!1001 &625076020 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 669015391} - m_Modifications: - - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_Name - value: Monolith POI - objectReference: {fileID: 0} - - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_Layer - value: 31 - objectReference: {fileID: 0} - - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_TagString - value: POI - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6907383477543755845, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: weight - value: 0.606 - objectReference: {fileID: 0} - - target: {fileID: 6907383477543755845, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - propertyPath: reEnableWaitTime - value: 60 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} ---- !u!1 &669015387 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 669015391} - - component: {fileID: 669015390} - - component: {fileID: 669015389} - - component: {fileID: 669015388} - m_Layer: 0 - m_Name: Monolith - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!136 &669015388 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669015387} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - m_Radius: 0.5000001 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} ---- !u!23 &669015389 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669015387} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &669015390 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669015387} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &669015391 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669015387} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -56.669678, y: 89.13, z: 300.99213} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 2135005361} - - {fileID: 1886784008} - m_Father: {fileID: 0} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &843506666 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 843506669} - - component: {fileID: 843506668} - - component: {fileID: 843506667} - m_Layer: 0 - m_Name: Terrain_0_0-20200608 - 021553 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 127 - m_IsActive: 1 ---- !u!154 &843506667 -TerrainCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 843506666} - m_Material: {fileID: 0} - m_Enabled: 1 - m_TerrainData: {fileID: 15600000, guid: cc9a6a0c5ae67d2449a640a92e8e268e, type: 2} - m_EnableTreeColliders: 1 ---- !u!218 &843506668 -Terrain: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 843506666} - m_Enabled: 1 - serializedVersion: 6 - m_TerrainData: {fileID: 15600000, guid: cc9a6a0c5ae67d2449a640a92e8e268e, type: 2} - m_TreeDistance: 4019 - m_TreeBillboardDistance: 1117 - m_TreeCrossFadeLength: 200 - m_TreeMaximumFullLODCount: 50 - m_DetailObjectDistance: 211 - m_DetailObjectDensity: 0.46 - m_HeightmapPixelError: 5 - m_SplatMapDistance: 512 - m_HeightmapMaximumLOD: 0 - m_ShadowCastingMode: 2 - m_DrawHeightmap: 1 - m_DrawInstanced: 1 - m_DrawTreesAndFoliage: 1 - m_ReflectionProbeUsage: 1 - m_MaterialTemplate: {fileID: 10652, guid: 0000000000000000f000000000000000, type: 0} - m_BakeLightProbesForTrees: 0 - m_PreserveTreePrototypeLayers: 0 - m_DeringLightProbesForTrees: 1 - m_ScaleInLightmap: 0.025 - m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} - m_GroupingID: 0 - m_RenderingLayerMask: 1 - m_AllowAutoConnect: 1 ---- !u!4 &843506669 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 843506666} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -512, y: 0, z: -512} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &892549802 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 7436454432037329914, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_Name - value: House 1 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalPosition.x - value: 152.65 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalPosition.y - value: 61.27 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalPosition.z - value: -35.69 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalRotation.w - value: 0.97516584 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalRotation.y - value: -0.22147608 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: -25.591 - objectReference: {fileID: 0} - - target: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3587514a3d7225644867bd310508e1d6, type: 3} ---- !u!1001 &986391264 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1817917201698718570, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_Name - value: Waypoint Spawner - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalPosition.y - value: 56.4 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: SizeX - value: 500 - objectReference: {fileID: 0} - - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: SizeY - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} - propertyPath: SizeZ - value: 500 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} ---- !u!1001 &1553094054 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1915163266} - m_Modifications: - - target: {fileID: 146072, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_Name - value: Waypoint - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalPosition.y - value: 1.218 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434040, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: weight - value: 0.671 - objectReference: {fileID: 0} - - target: {fileID: 6907383477543755845, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} - propertyPath: reEnableWaitTime - value: 15 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: ad452806b554e9b4e942ccc6439b68d5, type: 3} ---- !u!1 &1886784007 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1886784008} - m_Layer: 0 - m_Name: Monolith POI (Missing Prefab) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1886784008 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1886784007} - 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: 669015391} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1908718749 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1908718751} - - component: {fileID: 1908718750} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1908718750 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1908718749} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 0.97 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1908718751 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1908718749} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!4 &1915163266 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 7436454432037329918, guid: 3587514a3d7225644867bd310508e1d6, type: 3} - m_PrefabInstance: {fileID: 892549802} - m_PrefabAsset: {fileID: 0} ---- !u!1 &2121742395 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2135005361} - m_Layer: 0 - m_Name: Missing Prefab (Dummy) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2135005361 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} - m_PrefabInstance: {fileID: 625076020} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2121742395} - 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: 669015391} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Scenes/Terrain Scene.unity.meta b/Scenes/Terrain Scene.unity.meta deleted file mode 100644 index 80e92c5..0000000 --- a/Scenes/Terrain Scene.unity.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 2a7c1c8c0ddc5be4c837b9dd528c52aa -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 0e7732a..32103b3 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -124,10 +124,17 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } } + + /// + /// Test to see if the body has reached its destination. If no destination is currently set this will + /// always return true. + /// internal bool hasReachedDestination { get { + if (destination == null) return true; + return (rigidbody.transform.position - destination.position).magnitude <= m_ArrivalDistance; } } From 7385e935fd7ec4fe7b349c0d8e94bd88340f0e5f Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 01:12:27 -0800 Subject: [PATCH 12/36] Add take off back in --- Animations/DragonController.controller | 597 ++++++++++- Animations/Placeholders/Ground Idle 1.anim | 53 + .../Placeholders/Ground Idle 1.anim.meta | 8 + Scenes/Terrain Scene.unity | 939 ++++++++++++++++++ Scenes/Terrain Scene.unity.meta | 7 + Scripts/Runtime/Steering/FlyingSteeringRig.cs | 94 +- 6 files changed, 1637 insertions(+), 61 deletions(-) create mode 100644 Animations/Placeholders/Ground Idle 1.anim create mode 100644 Animations/Placeholders/Ground Idle 1.anim.meta create mode 100644 Scenes/Terrain Scene.unity create mode 100644 Scenes/Terrain Scene.unity.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 699179d..3e1e578 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -63,6 +63,28 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1101 &-6409865991935553825 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5390586394938884688} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.45 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!206 &-6390963665721911578 BlendTree: m_ObjectHideFlags: 1 @@ -126,7 +148,51 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1101 &-5621913499797024570 +--- !u!1102 &-6062263935054202883 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Flight + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -4113568117264443117} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 2102132162150371118} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1109 &-4678224719129570272 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: verticalVelocity + m_EventTreshold: 0.05 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1368909181614760674} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 +--- !u!1101 &-4113568117264443117 AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} @@ -138,7 +204,29 @@ AnimatorStateTransition: m_ConditionEvent: glide m_EventTreshold: 0.4 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 3062000143290070295} + m_DstState: {fileID: 8818472427370911743} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-4026105901526405743 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -6062263935054202883} m_Solo: 0 m_Mute: 0 m_IsExit: 0 @@ -151,21 +239,49 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1107 &-2323046387310864844 +--- !u!1107 &-3305796469165601778 AnimatorStateMachine: serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Base Layer + m_Name: Flying m_ChildStates: - serializedVersion: 1 - m_State: {fileID: 7929321913217887456} - m_Position: {x: 470, y: 110, z: 0} + m_State: {fileID: -6062263935054202883} + m_Position: {x: 460, y: 130, z: 0} + - serializedVersion: 1 + m_State: {fileID: 8818472427370911743} + m_Position: {x: 460, y: 280, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1368909181614760674} + m_Position: {x: 460, y: -140, z: 0} + - serializedVersion: 1 + m_State: {fileID: 5390586394938884688} + m_Position: {x: 460, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 460, y: -300, z: 0} + m_DefaultState: {fileID: -6062263935054202883} +--- !u!1107 &-3192933728264777258 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_ChildStates: - serializedVersion: 1 - m_State: {fileID: 3062000143290070295} - m_Position: {x: 470, y: 270, z: 0} + m_State: {fileID: 4508942873295745061} + m_Position: {x: 410, y: 90, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -175,8 +291,61 @@ AnimatorStateMachine: m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 7929321913217887456} ---- !u!1101 &-2227351312352247077 + m_DefaultState: {fileID: 4508942873295745061} +--- !u!1107 &-2323046387310864844 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: [] + m_ChildStateMachines: + - serializedVersion: 1 + m_StateMachine: {fileID: -3192933728264777258} + m_Position: {x: 410, y: 120, z: 0} + - serializedVersion: 1 + m_StateMachine: {fileID: -3305796469165601778} + m_Position: {x: 410, y: 260, z: 0} + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: + - first: {fileID: -3192933728264777258} + second: + - {fileID: -4678224719129570272} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 4508942873295745061} +--- !u!1101 &-840008826692192264 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: forwardVelocity + m_EventTreshold: 0.05 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-40628600873809189 AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} @@ -188,7 +357,7 @@ AnimatorStateTransition: m_ConditionEvent: glide m_EventTreshold: 0.4 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 7929321913217887456} + m_DstState: {fileID: -6062263935054202883} m_Solo: 0 m_Mute: 0 m_IsExit: 0 @@ -196,7 +365,7 @@ AnimatorStateTransition: m_TransitionDuration: 0.25 m_TransitionOffset: 0 m_ExitTime: 0.75 - m_HasExitTime: 1 + m_HasExitTime: 0 m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 @@ -259,57 +428,148 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} ---- !u!206 &2091492798866408738 +--- !u!1102 &1368909181614760674 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Take Off + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -6409865991935553825} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 5762736684047287387} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &1940849809455141935 BlendTree: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Blend Tree + m_Name: Fly Down m_Childs: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} - m_Threshold: -0.95 - m_Position: {x: 0, y: 0} + m_Threshold: 13 + m_Position: {x: -0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: roll + m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} - m_Threshold: 0 - m_Position: {x: 0, y: 0} + m_Threshold: 18 + m_Position: {x: 0, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: roll + m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} - m_Threshold: 0.9 - m_Position: {x: 0, y: 0} + m_Threshold: 23 + m_Position: {x: 0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 - m_DirectBlendParameter: roll + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} + m_Threshold: 28 + m_Position: {x: -0.7, y: -0.8} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} + m_Threshold: 33 + m_Position: {x: 0, y: -0.8} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} + m_Threshold: 38 + m_Position: {x: 0.7, y: -0.8} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity m_Mirror: 0 m_BlendParameter: yaw - m_BlendParameterY: roll - m_MinThreshold: -0.95 - m_MaxThreshold: 0.9 + m_BlendParameterY: verticalVelocity + m_MinThreshold: 13 + m_MaxThreshold: 38 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 3 +--- !u!206 &2102132162150371118 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Flight + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 1940849809455141935} + m_Threshold: -0.2 + m_Position: {x: -1, y: -0.2} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 6334421064192970886} + m_Threshold: 0.4 + m_Position: {x: 0.2, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 6807847240973777812} + m_Threshold: 1 + m_Position: {x: 1, y: 0.2} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + m_BlendParameter: pitch + m_BlendParameterY: pitch + m_MinThreshold: -0.2 + m_MaxThreshold: 1 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 ---- !u!1102 &3062000143290070295 +--- !u!1102 &4508942873295745061 AnimatorState: serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Glide + m_Name: Ground Idle 1 m_Speed: 1 m_CycleOffset: 0 m_Transitions: - - {fileID: -2227351312352247077} + - {fileID: 4891491047935572450} + - {fileID: -840008826692192264} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -319,12 +579,37 @@ AnimatorState: m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 - m_Motion: {fileID: 2091492798866408738} + m_Motion: {fileID: 7400000, guid: ffef967343d4cb74ebc5c4f9a520cb1e, type: 2} m_Tag: m_SpeedParameter: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1101 &4891491047935572450 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: verticalVelocity + m_EventTreshold: 0.05 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!206 &5237996256603445452 BlendTree: m_ObjectHideFlags: 1 @@ -396,18 +681,18 @@ BlendTree: m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1102 &7929321913217887456 +--- !u!1102 &5390586394938884688 AnimatorState: serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Flight + m_Name: Fly m_Speed: 1 m_CycleOffset: 0 m_Transitions: - - {fileID: -5621913499797024570} + - {fileID: -4026105901526405743} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -417,48 +702,262 @@ AnimatorState: m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 - m_Motion: {fileID: 8110355964824687831} + m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Tag: m_SpeedParameter: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: ---- !u!206 &8110355964824687831 +--- !u!206 &5762736684047287387 BlendTree: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Flight + m_Name: Blend Tree m_Childs: - serializedVersion: 2 - m_Motion: {fileID: -8904977728813876417} - m_Threshold: -0.2 - m_Position: {x: -1, y: -0.2} + m_Motion: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} + m_Threshold: 0.3 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: forwardVelocity + m_BlendParameterY: roll + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!206 &6311787111152291628 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} + m_Threshold: -0.95 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} + m_Threshold: 0.9 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: yaw + m_BlendParameterY: roll + m_MinThreshold: -0.95 + m_MaxThreshold: 0.9 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!206 &6334421064192970886 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Level + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} + m_Threshold: 0.2 + m_Position: {x: -0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 5237996256603445452} - m_Threshold: 0.4 - m_Position: {x: 0.2, y: 0} + m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} + m_Threshold: 0.2979592 + m_Position: {x: 0, y: 0.5} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: -6390963665721911578} - m_Threshold: 1 - m_Position: {x: 1, y: 0.2} + m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} + m_Threshold: 0.39591837 + m_Position: {x: 0.6, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity m_Mirror: 0 - m_BlendParameter: pitch + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} + m_Threshold: 0.4938776 + m_Position: {x: -0.4, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 716784733869f5f44855acc139951a66, type: 2} + m_Threshold: 0.59183675 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} + m_Threshold: 0.689796 + m_Position: {x: 0.4, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 158e99599478daf43ae8974ce40e44d2, type: 2} + m_Threshold: 0.78775513 + m_Position: {x: 0, y: -1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + m_BlendParameter: yaw + m_BlendParameterY: forwardVelocity + m_MinThreshold: 0.2 + m_MaxThreshold: 0.78775513 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 3 +--- !u!206 &6807847240973777812 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fly Up + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} + m_Threshold: 14 + m_Position: {x: -0.5, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} + m_Threshold: 18 + m_Position: {x: 0, y: 0} + m_TimeScale: 1.4 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} + m_Threshold: 22 + m_Position: {x: 0.5, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} + m_Threshold: 26 + m_Position: {x: -0.7, y: 0.7} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} + m_Threshold: 30 + m_Position: {x: 0, y: 0.8} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} + m_Threshold: 34 + m_Position: {x: 0.7, y: 0.7} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: angularVelocity + m_Mirror: 0 + m_BlendParameter: yaw m_BlendParameterY: pitch - m_MinThreshold: -0.2 - m_MaxThreshold: 1 + m_MinThreshold: 14 + m_MaxThreshold: 34 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 - m_BlendType: 0 + m_BlendType: 3 +--- !u!1109 &7746444506946679310 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -6062263935054202883} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 +--- !u!1102 &8818472427370911743 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Glide + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -40628600873809189} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 6311787111152291628} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Animations/Placeholders/Ground Idle 1.anim b/Animations/Placeholders/Ground Idle 1.anim new file mode 100644 index 0000000..992ee06 --- /dev/null +++ b/Animations/Placeholders/Ground Idle 1.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ground Idle 1 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Ground Idle 1.anim.meta b/Animations/Placeholders/Ground Idle 1.anim.meta new file mode 100644 index 0000000..deb6ed6 --- /dev/null +++ b/Animations/Placeholders/Ground Idle 1.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ffef967343d4cb74ebc5c4f9a520cb1e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scenes/Terrain Scene.unity b/Scenes/Terrain Scene.unity new file mode 100644 index 0000000..89ed5fc --- /dev/null +++ b/Scenes/Terrain Scene.unity @@ -0,0 +1,939 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &997132 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 189694, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_Name + value: Camera Follow Target + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalPosition.x + value: 138.9 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalPosition.y + value: 62.8 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 66ad839bbf327b946b3ca0cbbd729738, type: 3} +--- !u!4 &1516906 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 481132, guid: 66ad839bbf327b946b3ca0cbbd729738, + type: 3} + m_PrefabInstance: {fileID: 997132} + m_PrefabAsset: {fileID: 0} +--- !u!1 &202775237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 202775238} + - component: {fileID: 202775241} + - component: {fileID: 202775240} + - component: {fileID: 202775239} + - component: {fileID: 202775242} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &202775238 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 202775237} + m_LocalRotation: {x: 1e-45, y: 0.707107, z: -1e-45, w: 0.70710665} + m_LocalPosition: {x: 136.9, y: 62.8, z: 0.0000009536743} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &202775239 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 202775237} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} + m_Name: + m_EditorClassIdentifier: + volumeTrigger: {fileID: 202775238} + volumeLayer: + serializedVersion: 2 + m_Bits: 256 + stopNaNPropagation: 1 + finalBlitToCameraTarget: 0 + antialiasingMode: 2 + temporalAntialiasing: + jitterSpread: 0.75 + sharpness: 0.25 + stationaryBlending: 0.95 + motionBlending: 0.85 + subpixelMorphologicalAntialiasing: + quality: 2 + fastApproximateAntialiasing: + fastMode: 0 + keepAlpha: 0 + fog: + enabled: 1 + excludeSkybox: 1 + debugLayer: + lightMeter: + width: 512 + height: 256 + showCurves: 1 + histogram: + width: 512 + height: 256 + channel: 3 + waveform: + exposure: 0.12 + height: 256 + vectorscope: + size: 256 + exposure: 0.12 + overlaySettings: + linearDepth: 0 + motionColorIntensity: 4 + motionGridSize: 64 + colorBlindnessType: 0 + colorBlindnessStrength: 1 + m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} + m_ShowToolkit: 0 + m_ShowCustomSorter: 0 + breakBeforeColorGrading: 0 + m_BeforeTransparentBundles: [] + m_BeforeStackBundles: + - assemblyQualifiedName: IL3DN_Fog_PP, Assembly-CSharp, Version=1.0.0.0, Culture=neutral, + PublicKeyToken=null + - assemblyQualifiedName: Pinwheel.Poseidon.FX.PostProcessing.PUnderwater, Assembly-CSharp, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - assemblyQualifiedName: Pinwheel.Poseidon.FX.PostProcessing.PWetLens, Assembly-CSharp, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_AfterStackBundles: [] +--- !u!81 &202775240 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 202775237} + m_Enabled: 1 +--- !u!20 &202775241 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 202775237} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.6762638, g: 0.70359784, b: 0.8584906, a: 0} + m_projectionMatrixMode: 2 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 32.96973 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.1 + far clip plane: 5000 + field of view: 40 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!114 &202775242 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 202775237} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowDebugText: 0 + m_ShowCameraFrustum: 1 + m_IgnoreTimeScale: 0 + m_WorldUpOverride: {fileID: 0} + m_UpdateMethod: 2 + m_BlendUpdateMethod: 1 + m_DefaultBlend: + m_Style: 1 + m_Time: 2 + m_CustomCurve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_CustomBlends: {fileID: 0} + m_CameraCutEvent: + m_PersistentCalls: + m_Calls: [] + m_CameraActivatedEvent: + m_PersistentCalls: + m_Calls: [] +--- !u!1001 &291060662 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalPosition.x + value: 136.9 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalPosition.y + value: 62.8 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.0000009536743 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.70710665 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalRotation.x + value: 1e-45 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.707107 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalRotation.z + value: -1e-45 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748435, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_Follow + value: + objectReference: {fileID: 1516906} + - target: {fileID: 7970667151623748436, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_LookAt + value: + objectReference: {fileID: 1516906} + - target: {fileID: 7970667151623748437, guid: 4157d46c891d60947a292698863e54df, + type: 3} + propertyPath: m_Name + value: Follow CM vcam1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 4157d46c891d60947a292698863e54df, type: 3} +--- !u!1001 &625076020 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 669015391} + m_Modifications: + - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_Name + value: Monolith POI + objectReference: {fileID: 0} + - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_Layer + value: 31 + objectReference: {fileID: 0} + - target: {fileID: 146072, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_TagString + value: POI + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6907383477543755845, guid: 5b4c8307ce895cf43b4bfd9b34204148, + type: 3} + propertyPath: weight + value: 0.606 + objectReference: {fileID: 0} + - target: {fileID: 6907383477543755845, guid: 5b4c8307ce895cf43b4bfd9b34204148, + type: 3} + propertyPath: reEnableWaitTime + value: 60 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5b4c8307ce895cf43b4bfd9b34204148, type: 3} +--- !u!1 &669015387 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 669015391} + - component: {fileID: 669015390} + - component: {fileID: 669015389} + - component: {fileID: 669015388} + m_Layer: 0 + m_Name: Monolith + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!136 &669015388 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 669015387} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &669015389 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 669015387} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &669015390 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 669015387} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &669015391 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 669015387} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -56.669678, y: 89.13, z: 300.99213} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2135005361} + - {fileID: 1886784008} + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &843506666 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 843506669} + - component: {fileID: 843506668} + - component: {fileID: 843506667} + m_Layer: 0 + m_Name: Terrain_0_0-20200608 - 021553 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 127 + m_IsActive: 1 +--- !u!154 &843506667 +TerrainCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843506666} + m_Material: {fileID: 0} + m_Enabled: 1 + m_TerrainData: {fileID: 15600000, guid: cc9a6a0c5ae67d2449a640a92e8e268e, type: 2} + m_EnableTreeColliders: 1 +--- !u!218 &843506668 +Terrain: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843506666} + m_Enabled: 1 + serializedVersion: 6 + m_TerrainData: {fileID: 0} + m_TreeDistance: 4019 + m_TreeBillboardDistance: 1117 + m_TreeCrossFadeLength: 200 + m_TreeMaximumFullLODCount: 50 + m_DetailObjectDistance: 211 + m_DetailObjectDensity: 0.46 + m_HeightmapPixelError: 5 + m_SplatMapDistance: 512 + m_HeightmapMaximumLOD: 0 + m_ShadowCastingMode: 2 + m_DrawHeightmap: 1 + m_DrawInstanced: 1 + m_DrawTreesAndFoliage: 1 + m_ReflectionProbeUsage: 1 + m_MaterialTemplate: {fileID: 10652, guid: 0000000000000000f000000000000000, type: 0} + m_BakeLightProbesForTrees: 0 + m_PreserveTreePrototypeLayers: 0 + m_DeringLightProbesForTrees: 1 + m_ScaleInLightmap: 0.025 + m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} + m_GroupingID: 0 + m_RenderingLayerMask: 1 + m_AllowAutoConnect: 1 +--- !u!4 &843506669 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843506666} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -512, y: 0, z: -512} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &986391264 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1817917201698718570, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_Name + value: Waypoint Spawner + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalPosition.y + value: 56.4 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817917201698967928, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: SizeX + value: 500 + objectReference: {fileID: 0} + - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: SizeY + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 7629513432287551527, guid: 7b49dbdf54c68584c86d962e36d186ef, + type: 3} + propertyPath: SizeZ + value: 500 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7b49dbdf54c68584c86d962e36d186ef, type: 3} +--- !u!1 &1886784007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1886784008} + m_Layer: 0 + m_Name: Monolith POI (Missing Prefab) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1886784008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1886784007} + 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: 669015391} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1908718749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1908718751} + - component: {fileID: 1908718750} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1908718750 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1908718749} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 0.97 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1908718751 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1908718749} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &2121742395 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2135005361} + m_Layer: 0 + m_Name: Missing Prefab (Dummy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2135005361 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 434040, guid: 5b4c8307ce895cf43b4bfd9b34204148, + type: 3} + m_PrefabInstance: {fileID: 625076020} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2121742395} + 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: 669015391} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Scenes/Terrain Scene.unity.meta b/Scenes/Terrain Scene.unity.meta new file mode 100644 index 0000000..80e92c5 --- /dev/null +++ b/Scenes/Terrain Scene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2a7c1c8c0ddc5be4c837b9dd528c52aa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 32103b3..f2b158e 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -36,9 +36,11 @@ public class FlyingSteeringRig : MonoBehaviour " If this is true the following settings will confine the height.")] bool m_MaintainHeight = true; [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + - " should be. This is used as a validation check to ensure the object is not going below" + - " the terrain or through a mesh obstacles in the scene.")] + " should be. The body will always try to get higher if it drops below this height.")] float m_MinHeight = 1.5f; + [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + + " automatically land.")] + float m_LandingHeight = 0.5f; [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + " should be. This is used as a validation check to ensure the object is not going too" + " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + @@ -69,6 +71,38 @@ public class FlyingSteeringRig : MonoBehaviour /// public Transform destination { get; set; } + /// + /// Returns true if the body is currently on the ground. + /// + public bool isGrounded + { + get + { + return height <= 0.01f; + } + } + + /// + /// Returns the current height of the body above the nearest obstacle below it. + /// + public float height + { + get + { + //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame + + RaycastHit hit; + if (Physics.Raycast(rigidbody.position, Vector3.down, out hit, Mathf.Infinity)) + { + return hit.distance; + } + else + { + Debug.LogError("The raycast to get body height didn't hit anything. Returning a height of infinity, but this likely shouldn't happen."); + return Mathf.Infinity; + } + } + } private void Awake() { ConfigureSensors(); @@ -148,21 +182,35 @@ protected virtual void FixedUpdate() return; } + if (isGrounded) + { + GroundMovement(); + } + else + { + FlightPhysics(); + } + } + + private void FlightPhysics() + { Vector3 desiredDirection = (destination.position - rigidbody.transform.position); - Vector3 moveDirection = Vector3.zero; + Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) { moveDirection += desiredDirection.normalized; - } else + } + else { moveDirection += desiredDirection; } - + Vector3 repulsion = GetRepulsionDirection(); if (repulsion.sqrMagnitude > 0.01f) { moveDirection += repulsion.normalized; - } else + } + else { moveDirection += repulsion * 100; } @@ -182,7 +230,7 @@ protected virtual void FixedUpdate() float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; rigidbody.AddTorque(rigidbody.transform.forward * -force); - SetAnimationParameters(moveDirection); + SetAnimationParameters(); // Forward force to add float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); @@ -191,26 +239,48 @@ protected virtual void FixedUpdate() // Vertical force to add float verticalDotMove = Vector3.Dot(Vector3.up, moveDirection.normalized); float verticalForce = 0; - if (verticalDotMove > 0) { + if (verticalDotMove > 0) + { verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); } // Add the forces - rigidbody.AddForce((forwardForce * moveDirection.normalized) + rigidbody.AddForce((forwardForce * moveDirection.normalized) + (verticalForce * rigidbody.transform.up)); // Don't go over maximum speed rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed); } - void SetAnimationParameters(Vector3 moveDirection) + /// + /// Cacluate movement of the body when on the ground. + /// + private void GroundMovement() + { + Vector3 moveDirection = Vector3.zero; + + // take off + moveDirection = new Vector3(0, 1, 1); + + // Add the forces + //rigidbody.transform.Translate(Vector3.Lerp(rigidbody.transform.position, rigidbody.transform.TransformDirection(moveDirection), Time.deltaTime)); + } + void SetAnimationParameters() { if (!m_Animator) return; + if (isGrounded) + { + m_Animator.SetBool("isGrounded", true); + } + else + { + m_Animator.SetBool("isGrounded", false); + } Quaternion q = rigidbody.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); - float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); + //float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); float pitch; if (pitchRad <= 0) // up @@ -220,7 +290,7 @@ void SetAnimationParameters(Vector3 moveDirection) { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxDiveAngle; } - float yaw = yawRad / 1.52f; + //float yaw = yawRad / 1.52f; float roll = rollRad / 3.14f; float strafeVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.x; float verticalVelocity = rigidbody.velocity.normalized.y; From 39902ec856beacd03d127067bf46cdfad857be0d Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 08:27:14 -0800 Subject: [PATCH 13/36] Better handling of take-off prep for landing --- Animations/DragonController.controller | 145 ++++++++++++++++-- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 76 +++++++-- 2 files changed, 196 insertions(+), 25 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 3e1e578..f2a28db 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -63,6 +63,64 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1102 &-8188205827486385974 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Land + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -3871691291201631284} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: -6416401713070107847} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &-6416401713070107847 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} + m_Threshold: 0.4 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: roll + m_BlendParameterY: roll + m_MinThreshold: 0.4 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 --- !u!1101 &-6409865991935553825 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -160,6 +218,7 @@ AnimatorState: m_CycleOffset: 0 m_Transitions: - {fileID: -4113568117264443117} + - {fileID: -2175759424970179939} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -186,6 +245,9 @@ AnimatorTransition: - m_ConditionMode: 3 m_ConditionEvent: verticalVelocity m_EventTreshold: 0.05 + - m_ConditionMode: 2 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 1368909181614760674} m_Solo: 0 @@ -239,6 +301,31 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 +--- !u!1101 &-3871691291201631284 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1107 &-3305796469165601778 AnimatorStateMachine: serializedVersion: 6 @@ -253,13 +340,16 @@ AnimatorStateMachine: m_Position: {x: 460, y: 130, z: 0} - serializedVersion: 1 m_State: {fileID: 8818472427370911743} - m_Position: {x: 460, y: 280, z: 0} + m_Position: {x: 780, y: 130, z: 0} - serializedVersion: 1 m_State: {fileID: 1368909181614760674} m_Position: {x: 460, y: -140, z: 0} - serializedVersion: 1 m_State: {fileID: 5390586394938884688} m_Position: {x: 460, y: 0, z: 0} + - serializedVersion: 1 + m_State: {fileID: -8188205827486385974} + m_Position: {x: 460, y: 310, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -267,7 +357,7 @@ AnimatorStateMachine: m_StateMachineBehaviours: [] m_AnyStatePosition: {x: 50, y: 20, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0} - m_ExitPosition: {x: 800, y: 120, z: 0} + m_ExitPosition: {x: 820, y: 320, z: 0} m_ParentStateMachinePosition: {x: 460, y: -300, z: 0} m_DefaultState: {fileID: -6062263935054202883} --- !u!1107 &-3192933728264777258 @@ -281,7 +371,7 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: 4508942873295745061} - m_Position: {x: 410, y: 90, z: 0} + m_Position: {x: 410, y: 110, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -320,6 +410,31 @@ AnimatorStateMachine: m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_DefaultState: {fileID: 4508942873295745061} +--- !u!1101 &-2175759424970179939 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isLanding + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -8188205827486385974} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1101 &-840008826692192264 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -379,42 +494,54 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: + - m_Name: isGrounded + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: isLanding + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: forwardVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index f2b158e..fd60673 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -41,6 +41,9 @@ public class FlyingSteeringRig : MonoBehaviour [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + " automatically land.")] float m_LandingHeight = 0.5f; + [SerializeField, Tooltip("The height at which the body is considered to be grounded. Theoretically this should be zero," + + " however it will often be higher due to the models structure.")] + float m_GroundedHeight = 0.08f; [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + " should be. This is used as a validation check to ensure the object is not going too" + " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + @@ -78,7 +81,34 @@ public bool isGrounded { get { - return height <= 0.01f; + bool grounded = m_Animator.GetBool("isGrounded"); + bool landing = m_Animator.GetBool("isLanding"); + // Optimization: Use Hash not string + if (!grounded && landing && height <= m_GroundedHeight) // landed + { + m_Animator.SetBool("isLanding", false); + m_Animator.SetBool("isGrounded", true); + return true; + } + else if (grounded && height >= m_LandingHeight) // taken off + { + m_Animator.SetBool("isGrounded", false); + return false; + } + + return grounded; + } + } + + /// + /// Returns true if the body is in the process of landing. + /// + public bool isLanding + { + get + { + // Optimization: Use hash not string + return m_Animator.GetBool("isLanding") || rigidbody.position.y <= m_LandingHeight; } } @@ -146,6 +176,12 @@ Vector3 GetRepulsionDirection() Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { + if (destination.position.y < rigidbody.position.y && sensorArray[i].sensorDirection.y < 0) + { + // skip downwards sensors if we are trying to get low, this allows for landing and similar mechnics + continue; + } + strength += sensorArray[i].lastObstructionRatio; } @@ -157,6 +193,9 @@ private void Start() { originalAnimationSpeed = m_Animator.speed; } + + m_Animator.SetBool("isGrounded", height <= m_GroundedHeight); + m_Animator.SetBool("isLanding", false); } /// @@ -186,10 +225,19 @@ protected virtual void FixedUpdate() { GroundMovement(); } - else + else if (isLanding) + { + LandingPhysics(); + } else { FlightPhysics(); } + + SetAnimationParameters(); + } + + private void LandingPhysics() + { } private void FlightPhysics() @@ -230,8 +278,11 @@ private void FlightPhysics() float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; rigidbody.AddTorque(rigidbody.transform.forward * -force); - SetAnimationParameters(); + ApplyForces(moveDirection); + } + private void ApplyForces(Vector3 moveDirection) + { // Forward force to add float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); @@ -258,24 +309,17 @@ private void FlightPhysics() private void GroundMovement() { Vector3 moveDirection = Vector3.zero; + if (destination.position.y > m_LandingHeight) + { + // take off + moveDirection = new Vector3(0, 1000, 1000); + } - // take off - moveDirection = new Vector3(0, 1, 1); - - // Add the forces - //rigidbody.transform.Translate(Vector3.Lerp(rigidbody.transform.position, rigidbody.transform.TransformDirection(moveDirection), Time.deltaTime)); + ApplyForces(moveDirection); } void SetAnimationParameters() { if (!m_Animator) return; - if (isGrounded) - { - m_Animator.SetBool("isGrounded", true); - } - else - { - m_Animator.SetBool("isGrounded", false); - } Quaternion q = rigidbody.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); From 5038f0363039e2cb8cd8a17c66d0f525a4e199e8 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 09:15:03 -0800 Subject: [PATCH 14/36] Some take off and landing tweaks --- Scripts/Runtime/MoveToWaypoint.cs | 2 ++ Scripts/Runtime/Steering/FlyingSteeringRig.cs | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 335c67f..b160563 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -103,6 +103,8 @@ bool IsStuck { get { + if (m_SteeringRig.isLanding) return false; + if (Vector3.SqrMagnitude(oldPosition - transform.position) < sqrStuckTolerance) { timeToStuck -= Time.deltaTime; diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index fd60673..00328e5 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -177,8 +177,11 @@ Vector3 GetRepulsionDirection() for (int i = 0; i < sensorArray.Length; i++) { if (destination.position.y < rigidbody.position.y && sensorArray[i].sensorDirection.y < 0) + if ((destination.position - rigidbody.position).sqrMagnitude <= 3 + && destination.position.y < rigidbody.position.y + && sensorArray[i].sensorDirection.y < 0) { - // skip downwards sensors if we are trying to get low, this allows for landing and similar mechnics + // skip downwards sensors are ignored if we are trying to get low, this allows for landing and similar mechanics continue; } @@ -242,7 +245,8 @@ private void LandingPhysics() private void FlightPhysics() { - Vector3 desiredDirection = (destination.position - rigidbody.transform.position); + Vector3 desiredDirection = (destination.position - rigidbody.position); + Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) { @@ -288,12 +292,7 @@ private void ApplyForces(Vector3 moveDirection) float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); // Vertical force to add - float verticalDotMove = Vector3.Dot(Vector3.up, moveDirection.normalized); - float verticalForce = 0; - if (verticalDotMove > 0) - { - verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(verticalDotMove)); - } + float verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(moveDirection.normalized.y)); // Add the forces rigidbody.AddForce((forwardForce * moveDirection.normalized) From eaf9a9f782b82b363af4e9233d0acfe744e6486a Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 31 Jan 2022 21:42:17 -0800 Subject: [PATCH 15/36] Improved take-off mechanic. Move all state tracking into the animator. --- Animations/DragonController.controller | 3 - Scripts/Runtime/MoveToWaypoint.cs | 2 + Scripts/Runtime/Steering/FlyingSteeringRig.cs | 86 +++++++++++++------ 3 files changed, 62 insertions(+), 29 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index f2a28db..52a088a 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -245,9 +245,6 @@ AnimatorTransition: - m_ConditionMode: 3 m_ConditionEvent: verticalVelocity m_EventTreshold: 0.05 - - m_ConditionMode: 2 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 1368909181614760674} m_Solo: 0 diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index b160563..74c36af 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -104,6 +104,8 @@ bool IsStuck get { if (m_SteeringRig.isLanding) return false; + if (m_SteeringRig.isIdle) return false; + if (m_SteeringRig.isTakingOff) return false; if (Vector3.SqrMagnitude(oldPosition - transform.position) < sqrStuckTolerance) { diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 00328e5..8dafcd7 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -74,29 +74,42 @@ public class FlyingSteeringRig : MonoBehaviour /// public Transform destination { get; set; } + + /// - /// Returns true if the body is currently on the ground. + /// Returns true if the body is in an idle state. /// + public bool isIdle + { + get + { + // Optimization: Use hash not string + return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Idle"); + } + } + + + /// + /// Returns true if the body is currently on the ground. + /// public bool isGrounded { get { - bool grounded = m_Animator.GetBool("isGrounded"); - bool landing = m_Animator.GetBool("isLanding"); - // Optimization: Use Hash not string - if (!grounded && landing && height <= m_GroundedHeight) // landed - { - m_Animator.SetBool("isLanding", false); - m_Animator.SetBool("isGrounded", true); - return true; - } - else if (grounded && height >= m_LandingHeight) // taken off - { - m_Animator.SetBool("isGrounded", false); - return false; - } + // Optimization: Use hash not string + return m_Animator.GetBool("isGrounded"); + } + } - return grounded; + /// + /// Returns true if the body is in the process of taking off. + /// + public bool isTakingOff + { + get + { + // Optimization: Use hash not string + return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Take Off"); } } @@ -108,7 +121,17 @@ public bool isLanding get { // Optimization: Use hash not string - return m_Animator.GetBool("isLanding") || rigidbody.position.y <= m_LandingHeight; + return m_Animator.GetBool("isLanding"); + } + } + + public bool isFlying + { + get + { + // Optimization: Use hash not string + return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Flight") + || m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Glide"); } } @@ -176,7 +199,6 @@ Vector3 GetRepulsionDirection() Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { - if (destination.position.y < rigidbody.position.y && sensorArray[i].sensorDirection.y < 0) if ((destination.position - rigidbody.position).sqrMagnitude <= 3 && destination.position.y < rigidbody.position.y && sensorArray[i].sensorDirection.y < 0) @@ -226,7 +248,14 @@ protected virtual void FixedUpdate() if (isGrounded) { - GroundMovement(); + if (destination.position.y >= m_MinHeight) + { + TakeOff(); + } + else + { + GroundMovement(); + } } else if (isLanding) { @@ -303,19 +332,24 @@ private void ApplyForces(Vector3 moveDirection) } /// - /// Cacluate movement of the body when on the ground. + /// Apply rules to cause the body to take off from a grounded position /// - private void GroundMovement() + private void TakeOff() { Vector3 moveDirection = Vector3.zero; - if (destination.position.y > m_LandingHeight) - { - // take off - moveDirection = new Vector3(0, 1000, 1000); - } + moveDirection = new Vector3(0, 1000, 1000); + // OPTIMIZATION: use hash + m_Animator.SetBool("isGrounded", false); ApplyForces(moveDirection); } + + /// + /// Apply on the ground movement rules. + /// + private void GroundMovement() + { + } void SetAnimationParameters() { if (!m_Animator) return; From cc514f15c4908ad5f4f996d5bf1e4fbe1c53c17b Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 19 Feb 2022 10:37:18 -0800 Subject: [PATCH 16/36] Aborted attempt to improve as part of Messy Game Jam --- Animations/DragonController.controller | 79 ++-- Animations/Placeholders/Land Forward.anim | 53 +++ .../Placeholders/Land Forward.anim.meta | 8 + Animations/Placeholders/Land Run.anim | 53 +++ Animations/Placeholders/Land Run.anim.meta | 8 + Animations/Placeholders/Take Off Forward.anim | 53 +++ .../Placeholders/Take Off Forward.anim.meta | 8 + Animations/Placeholders/Take Off Run.anim | 53 +++ .../Placeholders/Take Off Run.anim.meta | 8 + Animations/Placeholders/Take Off Up.anim | 53 +++ Animations/Placeholders/Take Off Up.anim.meta | 8 + Animations/Unka.overrideController | 18 +- Scripts/Editor/CameraSteeringRigEditor.cs | 163 -------- .../Editor/CameraSteeringRigEditor.cs.meta | 11 - Scripts/Runtime/BoxAreaSpawner.cs | 21 +- Scripts/Runtime/CameraSteeringRig.cs | 220 ----------- Scripts/Runtime/CameraSteeringRig.cs.meta | 11 - Scripts/Runtime/MoveToWaypoint.cs | 41 ++ Scripts/Runtime/SoundController.cs | 2 + Scripts/Runtime/Steering/FlyingSteeringRig.cs | 364 +++++++++++++----- Scripts/Runtime/WayPoint.cs | 2 +- .../Runtime/wizardscode.ai.explorer.asmdef | 3 +- 22 files changed, 687 insertions(+), 553 deletions(-) create mode 100644 Animations/Placeholders/Land Forward.anim create mode 100644 Animations/Placeholders/Land Forward.anim.meta create mode 100644 Animations/Placeholders/Land Run.anim create mode 100644 Animations/Placeholders/Land Run.anim.meta create mode 100644 Animations/Placeholders/Take Off Forward.anim create mode 100644 Animations/Placeholders/Take Off Forward.anim.meta create mode 100644 Animations/Placeholders/Take Off Run.anim create mode 100644 Animations/Placeholders/Take Off Run.anim.meta create mode 100644 Animations/Placeholders/Take Off Up.anim create mode 100644 Animations/Placeholders/Take Off Up.anim.meta delete mode 100644 Scripts/Editor/CameraSteeringRigEditor.cs delete mode 100644 Scripts/Editor/CameraSteeringRigEditor.cs.meta delete mode 100644 Scripts/Runtime/CameraSteeringRig.cs delete mode 100644 Scripts/Runtime/CameraSteeringRig.cs.meta diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 52a088a..4c09008 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -74,7 +74,7 @@ AnimatorState: m_Speed: 1 m_CycleOffset: 0 m_Transitions: - - {fileID: -3871691291201631284} + - {fileID: 3805648157650597287} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -99,7 +99,7 @@ BlendTree: m_Name: Blend Tree m_Childs: - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} + m_Motion: {fileID: 7400000, guid: c66c9d973a8b47d4f8a5a4d74b1d829e, type: 2} m_Threshold: 0.4 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -107,7 +107,7 @@ BlendTree: m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} + m_Motion: {fileID: 7400000, guid: 8ea768a6df46eff42ada5fb9df91c44f, type: 2} m_Threshold: 1 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -298,31 +298,6 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1101 &-3871691291201631284 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 1 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 0} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 1 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!1107 &-3305796469165601778 AnimatorStateMachine: serializedVersion: 6 @@ -355,7 +330,7 @@ AnimatorStateMachine: m_AnyStatePosition: {x: 50, y: 20, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 820, y: 320, z: 0} - m_ParentStateMachinePosition: {x: 460, y: -300, z: 0} + m_ParentStateMachinePosition: {x: 160, y: 250, z: 0} m_DefaultState: {fileID: -6062263935054202883} --- !u!1107 &-3192933728264777258 AnimatorStateMachine: @@ -496,49 +471,49 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: forwardVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -681,6 +656,28 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 +--- !u!1101 &3805648157650597287 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 4508942873295745061} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.6666666 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1102 &4508942873295745061 AnimatorState: serializedVersion: 6 @@ -688,7 +685,7 @@ AnimatorState: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Ground Idle 1 + m_Name: Idle m_Speed: 1 m_CycleOffset: 0 m_Transitions: @@ -841,7 +838,7 @@ BlendTree: m_Name: Blend Tree m_Childs: - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} + m_Motion: {fileID: 7400000, guid: 3adb37226d2cc804cbf549b0e919170d, type: 2} m_Threshold: 0 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -849,7 +846,7 @@ BlendTree: m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} + m_Motion: {fileID: 7400000, guid: 0f76f6d3b2f7b0e43932781861d8af17, type: 2} m_Threshold: 0.3 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -857,7 +854,7 @@ BlendTree: m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} + m_Motion: {fileID: 7400000, guid: b1bf5eb05923a6240afc3dfe8dc03d5f, type: 2} m_Threshold: 1 m_Position: {x: 0, y: 0} m_TimeScale: 1 diff --git a/Animations/Placeholders/Land Forward.anim b/Animations/Placeholders/Land Forward.anim new file mode 100644 index 0000000..552038b --- /dev/null +++ b/Animations/Placeholders/Land Forward.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Land Forward + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Land Forward.anim.meta b/Animations/Placeholders/Land Forward.anim.meta new file mode 100644 index 0000000..cb57da9 --- /dev/null +++ b/Animations/Placeholders/Land Forward.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c66c9d973a8b47d4f8a5a4d74b1d829e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Land Run.anim b/Animations/Placeholders/Land Run.anim new file mode 100644 index 0000000..0787139 --- /dev/null +++ b/Animations/Placeholders/Land Run.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Land Run + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Land Run.anim.meta b/Animations/Placeholders/Land Run.anim.meta new file mode 100644 index 0000000..25b152c --- /dev/null +++ b/Animations/Placeholders/Land Run.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ea768a6df46eff42ada5fb9df91c44f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Take Off Forward.anim b/Animations/Placeholders/Take Off Forward.anim new file mode 100644 index 0000000..736c034 --- /dev/null +++ b/Animations/Placeholders/Take Off Forward.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Take Off Forward + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Take Off Forward.anim.meta b/Animations/Placeholders/Take Off Forward.anim.meta new file mode 100644 index 0000000..e1d41b4 --- /dev/null +++ b/Animations/Placeholders/Take Off Forward.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f76f6d3b2f7b0e43932781861d8af17 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Take Off Run.anim b/Animations/Placeholders/Take Off Run.anim new file mode 100644 index 0000000..1d3e154 --- /dev/null +++ b/Animations/Placeholders/Take Off Run.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Take Off Run + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Take Off Run.anim.meta b/Animations/Placeholders/Take Off Run.anim.meta new file mode 100644 index 0000000..d74bfdb --- /dev/null +++ b/Animations/Placeholders/Take Off Run.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1bf5eb05923a6240afc3dfe8dc03d5f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Placeholders/Take Off Up.anim b/Animations/Placeholders/Take Off Up.anim new file mode 100644 index 0000000..d356ee0 --- /dev/null +++ b/Animations/Placeholders/Take Off Up.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Take Off Up + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Animations/Placeholders/Take Off Up.anim.meta b/Animations/Placeholders/Take Off Up.anim.meta new file mode 100644 index 0000000..3b961b0 --- /dev/null +++ b/Animations/Placeholders/Take Off Up.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3adb37226d2cc804cbf549b0e919170d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Animations/Unka.overrideController b/Animations/Unka.overrideController index 9e1e570..fcd71fc 100644 --- a/Animations/Unka.overrideController +++ b/Animations/Unka.overrideController @@ -41,9 +41,15 @@ AnimatorOverrideController: m_OverrideClip: {fileID: 7400048, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - m_OriginalClip: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_OverrideClip: {fileID: 7400050, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: c9b532f2b2c55b0409a5822a7aeffeb6, type: 2} - m_OverrideClip: {fileID: 7400008, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 6ea14cca7893ae448b5f6ecdcea029ee, type: 2} - m_OverrideClip: {fileID: 7400010, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} - - m_OriginalClip: {fileID: 7400000, guid: 705b9cfb18289ba4ca5016d9ac206754, type: 2} - m_OverrideClip: {fileID: 7400006, guid: 47c70e2dd99a9f14f90c8e037c1c792b, type: 3} + - m_OriginalClip: {fileID: 7400000, guid: ffef967343d4cb74ebc5c4f9a520cb1e, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 2d9e6064dadac784f902292c4d312940, type: 2} + - m_OriginalClip: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} + m_OverrideClip: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} + - m_OriginalClip: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 245aabe401e9a024c8aacbe4a865906b, type: 2} + - m_OriginalClip: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} + - m_OriginalClip: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} + m_OverrideClip: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} + - m_OriginalClip: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} + m_OverrideClip: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} diff --git a/Scripts/Editor/CameraSteeringRigEditor.cs b/Scripts/Editor/CameraSteeringRigEditor.cs deleted file mode 100644 index 1a5b103..0000000 --- a/Scripts/Editor/CameraSteeringRigEditor.cs +++ /dev/null @@ -1,163 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using SensorToolkit; -using UnityEditor; -using WizardsCode.AI; - -namespace WizardsCode.AIEditor -{ - [CustomEditor(typeof(CameraSteeringRig))] - public class CameraSteeringRigEditor : Editor - { - SerializedProperty ignoreList; - SerializedProperty avoidanceSensitivity; - SerializedProperty maxAvoidanceLength; - SerializedProperty yAxis; - SerializedProperty rotateTowardsTarget; - SerializedProperty rb; - SerializedProperty turnForce; - SerializedProperty moveForce; - SerializedProperty strafeForce; - SerializedProperty turnSpeed; - SerializedProperty moveSpeed; - SerializedProperty strafeSpeed; - SerializedProperty stoppingDistance; - SerializedProperty destinationTransform; - SerializedProperty faceTowardsTransform; - SerializedProperty maintainHeight; - SerializedProperty minHeight; - SerializedProperty maxHeight; - SerializedProperty optimalHeight; - SerializedProperty maxVerticalVelocity; - SerializedProperty maxForwardVelocity; - SerializedProperty animationController; - SerializedProperty randomizeX; - SerializedProperty randomizeY; - SerializedProperty randomizeZ; - SerializedProperty randomizationFrequency; - SerializedProperty randomizationFactor; - - CameraSteeringRig steeringRig; - - void OnEnable() - { - if (serializedObject == null) return; - - steeringRig = serializedObject.targetObject as CameraSteeringRig; - ignoreList = serializedObject.FindProperty("IgnoreList"); - avoidanceSensitivity = serializedObject.FindProperty("AvoidanceSensitivity"); - maxAvoidanceLength = serializedObject.FindProperty("MaxAvoidanceLength"); - yAxis = serializedObject.FindProperty("YAxis"); - rotateTowardsTarget = serializedObject.FindProperty("RotateTowardsTarget"); - rb = serializedObject.FindProperty("RB"); - turnForce = serializedObject.FindProperty("TurnForce"); - moveForce = serializedObject.FindProperty("MoveForce"); - strafeForce = serializedObject.FindProperty("StrafeForce"); - turnSpeed = serializedObject.FindProperty("TurnSpeed"); - moveSpeed = serializedObject.FindProperty("MoveSpeed"); - strafeSpeed = serializedObject.FindProperty("StrafeSpeed"); - stoppingDistance = serializedObject.FindProperty("StoppingDistance"); - destinationTransform = serializedObject.FindProperty("DestinationTransform"); - faceTowardsTransform = serializedObject.FindProperty("FaceTowardsTransform"); - maintainHeight = serializedObject.FindProperty("m_MaintainHeight"); - minHeight = serializedObject.FindProperty("minHeight"); - maxHeight = serializedObject.FindProperty("maxHeight"); - optimalHeight = serializedObject.FindProperty("optimalHeight"); - animationController = serializedObject.FindProperty("m_Animator"); - maxVerticalVelocity = serializedObject.FindProperty("m_MaxVerticalVelocity"); - maxForwardVelocity = serializedObject.FindProperty("m_MaxForwardVelocity"); - randomizeX = serializedObject.FindProperty("m_RandomizeX"); - randomizeY = serializedObject.FindProperty("m_RandomizeY"); - randomizeZ = serializedObject.FindProperty("m_RandomizeZ"); - randomizationFrequency = serializedObject.FindProperty("m_RandomizationFrequency"); - randomizationFactor = serializedObject.FindProperty("m_RandomizationFactor"); - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - - EditorGUILayout.PropertyField(ignoreList, true); - EditorGUILayout.PropertyField(avoidanceSensitivity); - EditorGUILayout.PropertyField(maxAvoidanceLength); - EditorGUILayout.PropertyField(yAxis); - EditorGUILayout.PropertyField(rotateTowardsTarget); - EditorGUILayout.PropertyField(rb); - if (rb.objectReferenceValue != null) - { - if ((rb.objectReferenceValue as Rigidbody).isKinematic) - { - EditorGUILayout.PropertyField(turnSpeed); - EditorGUILayout.PropertyField(moveSpeed); - EditorGUILayout.PropertyField(strafeSpeed); - } - else - { - EditorGUILayout.PropertyField(turnForce); - EditorGUILayout.PropertyField(moveForce); - EditorGUILayout.PropertyField(strafeForce); - } - EditorGUILayout.PropertyField(stoppingDistance); - EditorGUILayout.PropertyField(destinationTransform); - EditorGUILayout.PropertyField(faceTowardsTransform); - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Flight Randomization", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(randomizeX); - EditorGUILayout.PropertyField(randomizeY); - EditorGUILayout.PropertyField(randomizeZ); - if (randomizeX.boolValue || randomizeY.boolValue || randomizeZ.boolValue) - { - EditorGUILayout.PropertyField(randomizationFrequency); - EditorGUILayout.PropertyField(randomizationFactor); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Animation", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(animationController); - if (animationController.objectReferenceValue != null) - { - EditorGUILayout.PropertyField(maxVerticalVelocity); - EditorGUILayout.PropertyField(maxForwardVelocity); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Height Management", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(maintainHeight); - if (maintainHeight.boolValue) { - EditorGUILayout.PropertyField(minHeight); - EditorGUILayout.PropertyField(maxHeight); - EditorGUILayout.PropertyField(optimalHeight); - } - } - - displayErrors(); - - serializedObject.ApplyModifiedProperties(); - } - - void displayErrors() - { - EditorGUILayout.Space(); - var raySensors = steeringRig.GetComponentsInChildren(); - - if (raySensors.Length == 0) - { - EditorGUILayout.HelpBox("Steering Rig looks for child Ray Sensors to calculate avoidance vectors, you should add some.", MessageType.Warning); - } - else - { - for (int i = 0; i < raySensors.Length; i++) - { - if (raySensors[i].IgnoreList != null && raySensors[i].IgnoreList.Count > 0 && raySensors[i].IgnoreList != steeringRig.IgnoreList) - { - EditorGUILayout.HelpBox("One or more of the steering ray sensors has objects assigned to its IgnoreList parameter. " - + "These will be overwritten by the steering rigs IgnoreList.", MessageType.Warning); - break; - } - } - } - } - } -} diff --git a/Scripts/Editor/CameraSteeringRigEditor.cs.meta b/Scripts/Editor/CameraSteeringRigEditor.cs.meta deleted file mode 100644 index 1d808b3..0000000 --- a/Scripts/Editor/CameraSteeringRigEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 31c2c2b01c6232f4fb120560eac9b436 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index c901588..ad80a28 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -113,6 +113,7 @@ void Spawn() //OPTIMIZATION: Use a pool WayPoint go = Instantiate(ToSpawn) as WayPoint; + go.name += instanceCount++; int nTrys = 0; Vector3 pos; @@ -128,7 +129,6 @@ void Spawn() } while (LocationIsObstructed(pos, go)); go.transform.SetPositionAndRotation(pos, transform.rotation); - go.name += instanceCount++; go.transform.SetParent(transform.parent); spawned[nextSlot] = go.gameObject; } @@ -143,7 +143,7 @@ Vector3 ChooseLocation(WayPoint go) Vector3 dimensions = new Vector3(SizeX / 2f, maxHeight - minHeight, SizeZ / 2f); Vector3 randNormalizedVector = new Vector3(Random.Range(-1f, 1f), Random.Range(0, 1f), Random.Range(-1f, 1f)); Vector3 pos = Vector3.Scale(dimensions, randNormalizedVector) + transform.position; - pos.y += minHeight - transform.position.y; + pos.y += minHeight; pos = GetHeightAdjusted(pos, go); @@ -170,7 +170,6 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) clearance = (go.ClearRadius * 1.05f); } - //TODO: consider using just raycast, do we really need to measure terrain heigh. Consider that this will not take into account items onthe terrain, RaycastHit hit; float height = 0; bool hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); @@ -180,17 +179,13 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) if (AdjustHeight) { - if (pos.y < height + clearance) - { - pos.y = height + clearance; - } - else if (pos.y - height > maxHeight) + if (height + clearance < minHeight) { - pos.y = height + Random.Range(height + clearance, height + maxHeight); + pos.y = hit.point.y + minHeight + clearance; } - else + else if (height + clearance > maxHeight) { - Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); + pos.y = hit.point.y + maxHeight - clearance; } } @@ -208,6 +203,10 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) } } } + else + { + Debug.LogError($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); + } return pos; } diff --git a/Scripts/Runtime/CameraSteeringRig.cs b/Scripts/Runtime/CameraSteeringRig.cs deleted file mode 100644 index 6a95293..0000000 --- a/Scripts/Runtime/CameraSteeringRig.cs +++ /dev/null @@ -1,220 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using SensorToolkit; - -namespace WizardsCode.AI -{ - /// - /// A steering rig designed to drive a motion for a camera or a camera follow target. - /// - public class CameraSteeringRig : SteeringRig - { - [SerializeField, Tooltip("Try to keep the camera within a certain height range (true) or allow any height (false)." + - " If this is true the following settings will confine the height.")] - bool m_MaintainHeight = true; - [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + - " should be. This is used as a validation check to ensure the object is not going below" + - " the terrain or through a mesh obstacles in the scene.")] - float minHeight = 1.5f; - [SerializeField, Tooltip("The maximum height above the ground or nearest obstacle that this rig" + - " should be. This is used as a validation check to ensure the object is not going too" + - " far above the terrain or mesh obstacles in the scene. The camera may go above this height" + - " but if it does it will have forces placed upon it to move down.")] - float maxHeight = 10f; - [SerializeField, Tooltip("The optimal height above the ground or nearest obstacle that this rig" + - " should be. The camera is allowed to move from this height but it will recieve gentle forces" + - " encourage it to return to this height.")] - float optimalHeight = 2f; - - [SerializeField, Tooltip("The maximum vertical velocity this object is expected to reach. This is used to normalize the animator parameters.")] - float m_MaxVerticalVelocity = 6; - [SerializeField, Tooltip("The maximum vertical velocity this object is expected to reach. This is used to normalize the animator parameters.")] - float m_MaxForwardVelocity = 20; - - [SerializeField, Tooltip("The animation controller for updating speed accordingly.")] - private Animator m_Animator; - - [SerializeField, Tooltip("Should forces be applied randomly in the x direction.")] - private bool m_RandomizeX = true; - [SerializeField, Tooltip("Should forces be applied randomly in the y direction.")] - private bool m_RandomizeY = true; - [SerializeField, Tooltip("Should forces be applied randomly in the z direction. Since Z is (usually) the forward direction the speed of the animator will also be modified according to this value.")] - private bool m_RandomizeZ = true; - [SerializeField, Tooltip("Frequency of randomization force change in seconds. Each time the randomization force is changed it will be in the opposite direction to the last change, thus the change will not often push the object too far off course.")] - public float m_RandomizationFrequency = 3; - [SerializeField, Tooltip("The amount of randomization in each direction. The force in each direction will be adjusted up or down by this % amount.")] - [Range(0, 1f)] - float m_RandomizationFactor = 0.1f; - - private float timeOFRandomization; - private float speedVariation; - private float originalMoveForce; - private float targetMoveForce; - private float originalSpeed; - private Vector3 targetRandomizationForce; - - private void Start() - { - originalMoveForce = MoveForce; - - if (m_Animator) - { - originalSpeed = m_Animator.speed; - } - } - - /// - /// FIXME: This requires that the `SteeringRig.FixedUpdate` method is marked `protected virtual` which it is not out of the box. - /// I've made a request to do this at https://forum.unity.com/threads/released-sensor-toolkit.468255/ - /// but at the time of writing you will need to make this edit yourself. - /// - protected override void FixedUpdate() - { - base.FixedUpdate(); - - Vector3 additionalForce = MaintainHeight(); - - additionalForce += ApplyRandomizationForce(); - - RB.AddForce(additionalForce); - - SetAnimationParameters(); - } - - void SetAnimationParameters() - { - // TODO:Allow animations to be disabled - if (m_Animator) - { - Vector3 velocity = RB.transform.InverseTransformDirection(RB.velocity); - - //TODO: Use Hash not string - m_Animator.SetFloat("angularVelocity", RB.angularVelocity.y); - - if (velocity.y > 0) - { - m_Animator.SetFloat("verticalVelocity", Mathf.Clamp01(velocity.y / m_MaxVerticalVelocity)); - } - else - { - m_Animator.SetFloat("verticalVelocity", -Mathf.Clamp01(-velocity.y / m_MaxVerticalVelocity)); - } - if (velocity.z > 0) - { - m_Animator.SetFloat("forwardVelocity", Mathf.Clamp01(velocity.z / m_MaxForwardVelocity)); - } - else - { - m_Animator.SetFloat("forwardVelocity", -Mathf.Clamp01(-velocity.z / m_MaxForwardVelocity)); - } - } - } - - /// - /// Calculate a random force that will be added to the object to add variation to the flight. - /// - private Vector3 ApplyRandomizationForce() - { - Vector3 randomForce = Vector3.zero; - if (!(m_RandomizeX || m_RandomizeX || m_RandomizeX)) return randomForce; - - if (timeOFRandomization > Time.timeSinceLevelLoad) - { - randomForce = Vector3.Slerp(Vector3.zero, targetRandomizationForce, (Time.timeSinceLevelLoad - timeOFRandomization) / m_RandomizationFrequency); - return randomForce; - } - - timeOFRandomization = Time.timeSinceLevelLoad + m_RandomizationFrequency; - - float targetX = 0; - float targetY = 0; - float targetZ = 0; - if (m_RandomizeX) - { - if (Random.value < 0.7) - { - targetX = StrafeForce * (1 + Random.Range(-m_RandomizationFactor, m_RandomizationFactor)); - } - } - if (m_RandomizeY) - { - if (Random.value < 0.7) - { - targetY = MoveForce * (1 + Random.Range(-m_RandomizationFactor, m_RandomizationFactor)); - } - } - if (m_RandomizeZ) - { - if (Random.value < 0.7) - { - targetZ = 1 + Random.Range(-m_RandomizationFactor, m_RandomizationFactor); - - if (m_Animator) - { - m_Animator.speed = originalSpeed * targetZ; - } - - targetZ *= MoveForce; - } - } - - targetRandomizationForce = new Vector3(targetX, targetY, targetZ); - - return Vector3.Slerp(Vector3.zero, targetRandomizationForce, (Time.timeSinceLevelLoad - timeOFRandomization) / m_RandomizationFrequency); - } - - - /// - /// Get a force that is used to adjuste the height of the body based on the Height Management settings. - /// - /// A force to be applied to the body. - private Vector3 MaintainHeight() - { - Vector3 heightAdjustmentForce = Vector3.zero; - if (!m_MaintainHeight) return heightAdjustmentForce; - - RaycastHit hit; - float height = 0; - if (Physics.Raycast(RB.transform.position, Vector3.down, out hit, Mathf.Infinity)) - { - height = hit.distance; - } - else - { - Debug.LogWarning($"{name} has `Maintain Height` enabled but therre is no raycast hit below it. Relying on Steering Behaviours to keep things in order."); - return heightAdjustmentForce; - } - - /* What was this for? doesn't really do anything useful that I can think of. Commented out to see what it does... 1/24/22 - float waypointHeight = Destination.y - height; - - if (waypointHeight > optimalHeight || waypointHeight < optimalHeight) return; - */ - if (height > optimalHeight) - { - if (height > maxHeight) - { - heightAdjustmentForce = -RB.transform.up * Mathf.Lerp(0, MoveForce, Mathf.Clamp01((height - maxHeight) / maxHeight)); - } - else - { - heightAdjustmentForce = -RB.transform.up * Mathf.Lerp(0, MoveForce, Mathf.Clamp01((height - optimalHeight) / optimalHeight)); - } - } - else if (height < optimalHeight) - { - if (height < minHeight) - { - heightAdjustmentForce = RB.transform.up * Mathf.Lerp(0, MoveForce * 3, Mathf.Clamp01((minHeight - height) / minHeight)); - } - else - { - heightAdjustmentForce = RB.transform.up * Mathf.Lerp(0, MoveForce * 2, Mathf.Clamp01((optimalHeight - height) / optimalHeight)); - } - } - - return heightAdjustmentForce; - } - } -} diff --git a/Scripts/Runtime/CameraSteeringRig.cs.meta b/Scripts/Runtime/CameraSteeringRig.cs.meta deleted file mode 100644 index 9a7b702..0000000 --- a/Scripts/Runtime/CameraSteeringRig.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9b2d1f7c80dcdd648b0afb4e5d33fa69 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 74c36af..338c017 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -36,6 +36,14 @@ enum SelectionStrategy { nearest, furthest, random }; "Note if this is set to true but the Phot Session code is not present a warning will be displayed in the console.")] bool m_TakePhotoOnArrival = true; + [Header("Auto Enable/Disable")] + [SerializeField, Tooltip("If true this object will be enabled and disabled according to the paramters set below.")] + bool m_AutoDisable = true; + [SerializeField, Tooltip("If the object is at least this distance from the maincamera the object will be disabled.")] + int sqrDisableDistance = 1000; + [SerializeField, Tooltip("How frequently, in seconds, should this distance be checked?")] + float m_EnabledCheckInterval = 2.0f; + [Header("Configuration")] [SerializeField, Tooltip("If true the body will select a random waypoint as its starting position. " + "However, these waypoints must be present in the scene on start, spawned waypoints will not be considered. " + @@ -47,6 +55,7 @@ enum SelectionStrategy { nearest, furthest, random }; Vector3 oldPosition = Vector3.zero; float timeToStuck; float sqrStuckTolerance; + private Transform cameraTransform; List m_DetectedWayPoints = new List(); private WayPoint nextWaypoint; @@ -74,11 +83,43 @@ private void Start() timeToStuck = m_StuckDuration; sqrStuckTolerance = m_StuckTolerance * m_StuckTolerance; + if (m_AutoDisable) + { + cameraTransform = Camera.main.transform; + if (cameraTransform == null) { + Debug.LogError($"{name} is set to auto disable but no MainCamera is available in the scene."); + } + + sqrDisableDistance = sqrDisableDistance * sqrDisableDistance; + + InvokeRepeating("CheckEnableDisable", Random.value * m_EnabledCheckInterval, m_EnabledCheckInterval); + CheckEnableDisable(); + } + #if PHOTOSESSION_PRESENT photoSession = GameObject.FindObjectOfType(); #endif } + private void OnEnable() + { + timeToStuck = m_StuckDuration; + } + + void CheckEnableDisable() + { + if (gameObject.activeInHierarchy) { + if ((transform.position - cameraTransform.position).sqrMagnitude >= sqrDisableDistance) + { + gameObject.SetActive(false); + } + } + else if ((transform.position - cameraTransform.position).sqrMagnitude < sqrDisableDistance) + { + gameObject.SetActive(true); + } + } + WayPoint currentWaypoint { get diff --git a/Scripts/Runtime/SoundController.cs b/Scripts/Runtime/SoundController.cs index a544cd5..3c1d3bd 100644 --- a/Scripts/Runtime/SoundController.cs +++ b/Scripts/Runtime/SoundController.cs @@ -17,6 +17,8 @@ private void Awake() public void PlaySound() { + if (m_WingFlapClip.Length == 0) return; + audioSource.clip = m_WingFlapClip[Random.Range(0, m_WingFlapClip.Length)]; audioSource.pitch = Random.Range(0.95f, 1.05f); audioSource.Play(); diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 8dafcd7..5f1e763 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -1,6 +1,8 @@ using UnityEngine; using System.Collections; using System.Collections.Generic; +using static WizardsCode.AI.Sensor; +using WizardsCode.Character; namespace WizardsCode.AI { @@ -8,11 +10,11 @@ namespace WizardsCode.AI /// This rig provides a 3D navigation for flying creatures and objects. It detects opstacles on the expected path an flies over /// them or around them if it can. /// - public class FlyingSteeringRig : MonoBehaviour + public class FlyingSteeringRig : BaseActorController { [Header("Flight Controls")] [SerializeField, Tooltip("The rigid body that forces will be applied to to make the object fly (or fall in the case of gravity).")] - internal Rigidbody rigidbody; + internal Rigidbody rb; [SerializeField, Tooltip("Once the object is within this distance of the destination it is considered to have reached the destination.")] float m_ArrivalDistance = 1; [SerializeField, Tooltip("The maximum toque (turning force) that can be applied to this body. Higher values will result in tighter turns.")] @@ -32,12 +34,11 @@ public class FlyingSteeringRig : MonoBehaviour LayerMask m_AvoidanceLayers; [Header("Height Management")] - [SerializeField, Tooltip("Try to keep the camera within a certain height range (true) or allow any height (false)." + - " If this is true the following settings will confine the height.")] - bool m_MaintainHeight = true; [SerializeField, Tooltip("The minimum height above the ground or nearest obstacle that this rig" + " should be. The body will always try to get higher if it drops below this height.")] float m_MinHeight = 1.5f; + [SerializeField, Tooltip("Automatically land when below the landing height?")] + bool m_AutoLand = false; [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + " automatically land.")] float m_LandingHeight = 0.5f; @@ -60,14 +61,12 @@ public class FlyingSteeringRig : MonoBehaviour [Range(0, 90)] float m_MaxDiveAngle = 75; - [Header("Animation")] - [SerializeField, Tooltip("The animation controller for updating speed accordingly.")] - private Animator m_Animator; - private float originalAnimationSpeed; - private static Mesh cylinderCache; private Sensor[] sensorArray; int nextSensorToPulse = 0; + private float approachDistanceSqr; + private float prepareToLandDistanceSqr; + private float landingDistanceSqr; /// /// The transform of the current destination the object is flying to. @@ -83,8 +82,14 @@ public bool isIdle { get { - // Optimization: Use hash not string - return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Idle"); + if (m_Animator) + { + return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.idleState; + } + else + { + return false; + } } } @@ -96,8 +101,20 @@ public bool isGrounded { get { - // Optimization: Use hash not string - return m_Animator.GetBool("isGrounded"); + if (m_Animator) + { + return m_Animator.GetBool(AnimationHash.isGrounded); + } else + { + return false; + } + } + set + { + if (m_Animator && isGrounded != value) + { + m_Animator.SetBool(AnimationHash.isGrounded, value); + } } } @@ -108,8 +125,13 @@ public bool isTakingOff { get { - // Optimization: Use hash not string - return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Take Off"); + if (m_Animator) + { + return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.takeOffState; + } else + { + return false; + } } } @@ -120,8 +142,20 @@ public bool isLanding { get { - // Optimization: Use hash not string - return m_Animator.GetBool("isLanding"); + if (m_Animator) + { + return m_Animator.GetBool(AnimationHash.isLanding); + } else + { + return false; + } + } + set + { + if (m_Animator) + { + m_Animator.SetBool(AnimationHash.isLanding, value); + } } } @@ -129,9 +163,8 @@ public bool isFlying { get { - // Optimization: Use hash not string - return m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Flight") - || m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Glide"); + return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.flightState + || m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.glideState; } } @@ -145,20 +178,45 @@ public float height //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame RaycastHit hit; - if (Physics.Raycast(rigidbody.position, Vector3.down, out hit, Mathf.Infinity)) + if (Physics.Raycast(rb.position, Vector3.down, out hit, Mathf.Infinity)) { return hit.distance; } else { - Debug.LogError("The raycast to get body height didn't hit anything. Returning a height of infinity, but this likely shouldn't happen."); - return Mathf.Infinity; + return 0; } } } private void Awake() { ConfigureSensors(); + + float landingDistance = m_ArrivalDistance * 5f; + landingDistanceSqr = landingDistance * landingDistance; + + float prepareToLandDistance = landingDistance + (landingDistance * 2f); + prepareToLandDistanceSqr = prepareToLandDistance * prepareToLandDistance; + + float approachDistance = prepareToLandDistance + (landingDistance * 5f); + approachDistanceSqr = approachDistance * approachDistance; + } + + protected override void Update() + { + // FIXME: this overrides BaseActorController, so that we can use it in Ink directions, we currently override Update meaning none of the features of the base controller are used. + } + + public override void MoveTo(Transform destination) + { + WayPoint wp = destination.GetComponent(); + if (wp) + { + this.destination = destination; + } else + { + base.MoveTo(destination); + } } private void ConfigureSensors() @@ -192,6 +250,8 @@ private void ConfigureSensors() /// Vector3 GetRepulsionDirection() { + if (isLanding) return Vector3.zero; + sensorArray[nextSensorToPulse].Pulse(this); nextSensorToPulse++; if (nextSensorToPulse == sensorArray.Length) nextSensorToPulse = 0; @@ -199,14 +259,13 @@ Vector3 GetRepulsionDirection() Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { - if ((destination.position - rigidbody.position).sqrMagnitude <= 3 - && destination.position.y < rigidbody.position.y - && sensorArray[i].sensorDirection.y < 0) + if (destination.position.y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { - // skip downwards sensors are ignored if we are trying to get low, this allows for landing and similar mechanics + // skip downward sensors as they would result in a push back up as we are trying to go down. + // note that forward and up sensors can still result in a small upward force depending on + // the rotation of the body. This serves to force a levelling out as obstructions get nearer. continue; } - strength += sensorArray[i].lastObstructionRatio; } @@ -219,8 +278,8 @@ private void Start() originalAnimationSpeed = m_Animator.speed; } - m_Animator.SetBool("isGrounded", height <= m_GroundedHeight); - m_Animator.SetBool("isLanding", false); + isGrounded = height <= m_GroundedHeight; + isLanding = false; } /// @@ -233,7 +292,7 @@ internal bool hasReachedDestination { if (destination == null) return true; - return (rigidbody.transform.position - destination.position).magnitude <= m_ArrivalDistance; + return (rb.transform.position - destination.position).magnitude <= m_ArrivalDistance; } } protected virtual void FixedUpdate() @@ -248,7 +307,7 @@ protected virtual void FixedUpdate() if (isGrounded) { - if (destination.position.y >= m_MinHeight) + if (destination.position.y >= height + m_MinHeight) { TakeOff(); } @@ -270,12 +329,52 @@ protected virtual void FixedUpdate() private void LandingPhysics() { + rb.freezeRotation = true; + + // gravity is in effect so just wait + if (height < m_GroundedHeight) + { + isLanding = false; + isGrounded = true; + return; + } + + Vector3 desiredDirection; + Vector3 interimDestination = GetDestinationPointAdjustedForApproachHeight(); + + desiredDirection = (interimDestination - rb.position); + Vector3 moveDirection = Vector3.zero; + if (desiredDirection.sqrMagnitude > 1) + { + moveDirection += desiredDirection.normalized; + } + else + { + moveDirection += desiredDirection; + } + + //OPTIMIZATION: is it cheaper to create a single force and add it? + float z = rb.rotation.eulerAngles.z; + if (z > 180f) z -= 360f; + float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; + rb.AddTorque(rb.transform.forward * -force); + + float x = rb.rotation.eulerAngles.x; + if (x > 180f) z -= 360f; + force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; + rb.AddTorque(rb.transform.right * -force); + + ApplyForces(moveDirection); } private void FlightPhysics() { - Vector3 desiredDirection = (destination.position - rigidbody.position); + rb.freezeRotation = false; + + Vector3 desiredDirection; + Vector3 interimDestination = GetDestinationPointAdjustedForApproachHeight(); + desiredDirection = (interimDestination - rb.position); Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) { @@ -299,36 +398,86 @@ private void FlightPhysics() // Rotate towards the desired direction float angle; Vector3 axis; - Quaternion desiredRotation = Quaternion.FromToRotation(rigidbody.transform.forward, moveDirection); + Quaternion desiredRotation = Quaternion.FromToRotation(rb.transform.forward, moveDirection); desiredRotation.ToAngleAxis(out angle, out axis); angle = angle > 180f ? angle - 360f : angle; var torque = Mathf.Clamp(angle / 20f, -1f, 1f) * m_MaxTorque; - rigidbody.AddTorque(axis * torque); + rb.AddTorque(axis * torque); // Keep the bottom facing down - float z = rigidbody.rotation.eulerAngles.z; + float z = rb.rotation.eulerAngles.z; if (z > 180f) z -= 360f; float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; - rigidbody.AddTorque(rigidbody.transform.forward * -force); + rb.AddTorque(rb.transform.forward * -force); ApplyForces(moveDirection); } + /// + /// Create an interim point that is in the same x,z space as the destination but adjusted for height + /// to provide a good approach for landing or leisurely flight. + /// + private Vector3 GetDestinationPointAdjustedForApproachHeight() + { + Vector3 interimDestination = destination.position; + Vector3 desiredDirection = (destination.position - rb.position); + if (desiredDirection.sqrMagnitude > approachDistanceSqr) + { + if (height > m_OptimalHeight) + { + interimDestination.y = Mathf.Lerp(m_OptimalHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + } + else + { + interimDestination.y = Mathf.Lerp(height + destination.position.y, m_OptimalHeight + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + } + } + else if (m_AutoLand && desiredDirection.sqrMagnitude > prepareToLandDistanceSqr) + { + if (height > m_MinHeight) + { + interimDestination.y = Mathf.Lerp(m_MinHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); + } + else + { + interimDestination.y = Mathf.Lerp(destination.position.y + destination.position.y, m_MinHeight , desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); + } + } + else if (m_AutoLand && desiredDirection.sqrMagnitude > landingDistanceSqr) + { + if (height > m_LandingHeight) + { + interimDestination.y = Mathf.Lerp(height + destination.position.y, m_LandingHeight + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); + } + else + { + interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); + } + } + else if (m_AutoLand && destination.position.y < m_LandingHeight) + { + interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y, destination.position.y, Time.fixedDeltaTime); + isLanding = true; + } + + return interimDestination; + } + private void ApplyForces(Vector3 moveDirection) { // Forward force to add - float forwardDotMove = Vector3.Dot(rigidbody.transform.forward, moveDirection.normalized); + float forwardDotMove = Vector3.Dot(rb.transform.forward, moveDirection.normalized); float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); // Vertical force to add float verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(moveDirection.normalized.y)); // Add the forces - rigidbody.AddForce((forwardForce * moveDirection.normalized) - + (verticalForce * rigidbody.transform.up)); + rb.AddForce((forwardForce * moveDirection.normalized) + + (verticalForce * rb.transform.up)); // Don't go over maximum speed - rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed); + rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed); } /// @@ -336,10 +485,11 @@ private void ApplyForces(Vector3 moveDirection) /// private void TakeOff() { + rb.freezeRotation = false; + Vector3 moveDirection = Vector3.zero; moveDirection = new Vector3(0, 1000, 1000); - // OPTIMIZATION: use hash - m_Animator.SetBool("isGrounded", false); + isGrounded = false; ApplyForces(moveDirection); } @@ -349,12 +499,18 @@ private void TakeOff() /// private void GroundMovement() { + rb.freezeRotation = true; + + if (Random.value < 0.01) { + // FIXME: Add ground movement + TakeOff(); + } } void SetAnimationParameters() { if (!m_Animator) return; - Quaternion q = rigidbody.rotation; + Quaternion q = rb.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); //float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); @@ -369,9 +525,9 @@ void SetAnimationParameters() } //float yaw = yawRad / 1.52f; float roll = rollRad / 3.14f; - float strafeVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.x; - float verticalVelocity = rigidbody.velocity.normalized.y; - float forwardVelocity = transform.InverseTransformDirection(rigidbody.velocity).normalized.z; + float strafeVelocity = transform.InverseTransformDirection(rb.velocity).normalized.x; + float verticalVelocity = rb.velocity.normalized.y; + float forwardVelocity = transform.InverseTransformDirection(rb.velocity).normalized.z; bool glide = false; if (forwardVelocity > 0.9) @@ -379,63 +535,70 @@ void SetAnimationParameters() glide = pitch > -0.2 && pitch < 0.2; } - //OPTIMIZATION: Use Hash not string - m_Animator.SetFloat("yaw", strafeVelocity); + m_Animator.SetFloat(AnimationHash.yaw, strafeVelocity); if (pitch <= 0) // up { - m_Animator.SetFloat("pitch", pitch); + m_Animator.SetFloat(AnimationHash.pitch, pitch); } else // down { - m_Animator.SetFloat("pitch", pitch); + m_Animator.SetFloat(AnimationHash.pitch, pitch); } - m_Animator.SetFloat("roll", roll); - m_Animator.SetFloat("verticalVelocity", verticalVelocity); - m_Animator.SetFloat("forwardVelocity", forwardVelocity); - m_Animator.SetBool("glide", glide); + m_Animator.SetFloat(AnimationHash.roll, roll); + m_Animator.SetFloat(AnimationHash.verticalVelocity, verticalVelocity); + m_Animator.SetFloat(AnimationHash.forwardVelocity, forwardVelocity); + m_Animator.SetBool(AnimationHash.glide, glide); } private void OnDrawGizmosSelected() { + if (destination == null) return; + // Target Direction - if (destination != null) - { - Gizmos.color = Color.yellow; - Gizmos.DrawLine(rigidbody.transform.position, destination.position); - } + Gizmos.color = Color.yellow; + Gizmos.DrawLine(rb.transform.position, destination.position); // Sensors if (sensorArray == null || sensorArray.Length == 0) ConfigureSensors(); - for (int i = 0; i < sensorArray.Length; i++) + if (!isLanding) { - Vector3 direction = rigidbody.transform.TransformDirection(sensorArray[i].sensorDirection); - float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rigidbody.velocity.magnitude / maxSpeed)); - - Vector3 endPoint; - if (sensorArray[i].hit.collider == null) - { - endPoint = rigidbody.position + (direction * length); - Gizmos.color = Color.green; - } else - { - endPoint = rigidbody.position + (direction * sensorArray[i].hit.distance); - Gizmos.color = Color.red; - } - - if (sensorArray[i].radius > 0) + for (int i = 0; i < sensorArray.Length; i++) { - Gizmos.DrawLine(rigidbody.position, endPoint); - Gizmos.DrawWireSphere(endPoint, sensorArray[i].radius); - } - else - { - Gizmos.DrawLine(rigidbody.position, endPoint); + if (destination.position.y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { + continue; + } + + Vector3 direction = rb.transform.TransformDirection(sensorArray[i].sensorDirection); + float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); + + Vector3 endPoint; + if (sensorArray[i].hit.collider == null) + { + endPoint = rb.position + (direction * length); + Gizmos.color = Color.green; + } + else + { + endPoint = rb.position + (direction * sensorArray[i].hit.distance); + Gizmos.color = Color.red; + } + + if (sensorArray[i].radius > 0) + { + float currentRadius = Mathf.Lerp(0, sensorArray[i].radius, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); + Gizmos.DrawLine(rb.position, endPoint); + Gizmos.DrawWireSphere(endPoint, currentRadius); + } + else + { + Gizmos.DrawLine(rb.position, endPoint); + } } } } private void OnValidate() { - if (rigidbody == null) rigidbody = GetComponentInParent(); + if (rb == null) rb = GetComponentInParent(); } } @@ -497,13 +660,14 @@ public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceS /// public bool Pulse(FlyingSteeringRig rig) { - Vector3 direction = rig.rigidbody.transform.TransformDirection(this.sensorDirection); - float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rigidbody.velocity.magnitude / rig.maxSpeed)); + Vector3 direction = rig.rb.transform.TransformDirection(this.sensorDirection); + float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rb.velocity.magnitude / rig.maxSpeed)); - Ray ray = new Ray(rig.rigidbody.transform.position, direction); + Ray ray = new Ray(rig.rb.transform.position, direction); if (radius > 0) { - obstructionHit = Physics.SphereCast(ray, radius, out hit, length, avoidanceLayers); + float currentRadius = Mathf.Lerp(0, radius, Mathf.Clamp01(rig.rb.velocity.magnitude / rig.maxSpeed)); + obstructionHit = Physics.SphereCast(ray, currentRadius, out hit, length, avoidanceLayers); } else { @@ -512,5 +676,29 @@ public bool Pulse(FlyingSteeringRig rig) return obstructionHit; } + + internal static class AnimationHash + { + #region parameters + internal static int isGrounded = Animator.StringToHash("isGrounded"); + internal static int isLanding = Animator.StringToHash("isLanding"); + + internal static int roll = Animator.StringToHash("roll"); + internal static int pitch = Animator.StringToHash("pitch"); + internal static int yaw = Animator.StringToHash("yaw"); + + internal static int verticalVelocity = Animator.StringToHash("verticalVelocity"); + internal static int forwardVelocity = Animator.StringToHash("forwardVelocity"); + + internal static int glide = Animator.StringToHash("glide"); + #endregion + + #region states + internal static int idleState = Animator.StringToHash("Idle"); + internal static int takeOffState = Animator.StringToHash("Take Off"); + internal static int flightState = Animator.StringToHash("Flight"); + internal static int glideState = Animator.StringToHash("Glide"); + #endregion + } } } diff --git a/Scripts/Runtime/WayPoint.cs b/Scripts/Runtime/WayPoint.cs index 4ef8670..05467cd 100644 --- a/Scripts/Runtime/WayPoint.cs +++ b/Scripts/Runtime/WayPoint.cs @@ -15,7 +15,7 @@ public class WayPoint : MonoBehaviour { [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] public float ClearRadius = 1.8f; - [SerializeField, Tooltip("The relative weight of this waypoint in terms of it's interest. A higher value will increase the chances of this waypoint being selected all other choice factors being equal."), Range(0.001f, 1f)] + [SerializeField, Tooltip("The relative weight of this waypoint in terms of it's interest. A higher value will increase the chances of this waypoint being selected all other choice factors being equal. A weight of 0 means it will never be selected, this is useful when you want a waypoint that can only be assigned in code."), Range(0f, 1f)] internal float weight = 0.5f; [SerializeField, Tooltip("Time, in seconds, to wait before re-enabling the waypoint after it is visited. If 0 the waypoint will destroyed once visited.")] internal float reEnableWaitTime = 0; diff --git a/Scripts/Runtime/wizardscode.ai.explorer.asmdef b/Scripts/Runtime/wizardscode.ai.explorer.asmdef index 2223341..e850400 100644 --- a/Scripts/Runtime/wizardscode.ai.explorer.asmdef +++ b/Scripts/Runtime/wizardscode.ai.explorer.asmdef @@ -2,7 +2,8 @@ "name": "wizardscode.ai.explorer", "rootNamespace": "", "references": [ - "PhotoSession.Runtime" + "PhotoSession.Runtime", + "WizardsCode.Character" ], "includePlatforms": [], "excludePlatforms": [], From 079971dedfb919264367e43987b1917c5642d5d8 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sun, 20 Feb 2022 16:02:53 -0800 Subject: [PATCH 17/36] Fixes to the dragon controller, --- Animations/DragonController.controller | 24 ++++++++++++------------ Scripts/Runtime/BoxAreaSpawner.cs | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 4c09008..0151a24 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -243,7 +243,7 @@ AnimatorTransition: m_Name: m_Conditions: - m_ConditionMode: 3 - m_ConditionEvent: verticalVelocity + m_ConditionEvent: forwardVelocity m_EventTreshold: 0.05 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 1368909181614760674} @@ -471,49 +471,49 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: forwardVelocity m_Type: 1 - m_DefaultFloat: 0 + m_DefaultFloat: 1 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -714,8 +714,8 @@ AnimatorStateTransition: m_PrefabAsset: {fileID: 0} m_Name: m_Conditions: - - m_ConditionMode: 3 - m_ConditionEvent: verticalVelocity + - m_ConditionMode: 4 + m_ConditionEvent: forwardVelocity m_EventTreshold: 0.05 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 0} diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index ad80a28..b555557 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -151,7 +151,7 @@ Vector3 ChooseLocation(WayPoint go) } /// - /// Adjust the height of a position in the terrain to allow for any obstructions on the terrain. + /// Adjust the height of a position in the terrain or colliders below to allow for any obstructions on the terrain. /// /// The approximate position the object should be placed /// The game object to place at the position From 51ee230676865f111cf3952ca097660ffc340a70 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 21 Feb 2022 10:08:02 -0800 Subject: [PATCH 18/36] Some fine tuning of the dragon flight mechanics. --- Animations/DragonController.controller | 16 +++---- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 45 +++++++++++-------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 0151a24..3d36ee6 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -471,49 +471,49 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: forwardVelocity m_Type: 1 m_DefaultFloat: 1 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 5f1e763..0070ac7 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -12,6 +12,7 @@ namespace WizardsCode.AI /// public class FlyingSteeringRig : BaseActorController { + #region Inspector Parameters [Header("Flight Controls")] [SerializeField, Tooltip("The rigid body that forces will be applied to to make the object fly (or fall in the case of gravity).")] internal Rigidbody rb; @@ -60,6 +61,7 @@ public class FlyingSteeringRig : BaseActorController [SerializeField, Tooltip("The maximum dive angle that this body can lose vertical height with in a controlled way. 90 is stright down.")] [Range(0, 90)] float m_MaxDiveAngle = 75; + #endregion private float originalAnimationSpeed; private Sensor[] sensorArray; @@ -78,7 +80,7 @@ public class FlyingSteeringRig : BaseActorController /// /// Returns true if the body is in an idle state. /// - public bool isIdle + public override bool isIdle { get { @@ -188,8 +190,10 @@ public float height } } } - private void Awake() + protected override void Awake() { + base.Awake(); + ConfigureSensors(); float landingDistance = m_ArrivalDistance * 5f; @@ -204,7 +208,8 @@ private void Awake() protected override void Update() { - // FIXME: this overrides BaseActorController, so that we can use it in Ink directions, we currently override Update meaning none of the features of the base controller are used. + // FIXME: this overrides BaseActorController, so that we can use it in Ink directions. + // However, we currently override Update meaning none of the features of the base controller are enabled - is this a problem? } public override void MoveTo(Transform destination) @@ -222,13 +227,13 @@ public override void MoveTo(Transform destination) private void ConfigureSensors() { List sensors = new List(); - sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, m_AvoidanceLayers)); // forward - sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1.5f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/left - sensors.Add(new Sensor(transform.forward - transform.right, 1f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/left - sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/left/left - sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1.5f, maxSpeed * 0.6f, m_AvoidanceLayers)); // forward/forward/right - sensors.Add(new Sensor(transform.forward + transform.right, 1f, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right - sensors.Add(new Sensor(transform.forward + transform.right * 2, 0, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/right/right + sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, 1, m_AvoidanceLayers)); // forward + sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1.5f, maxSpeed * 0.6f, 0.9f, m_AvoidanceLayers)); // forward/forward/left + sensors.Add(new Sensor(transform.forward - transform.right, 1f, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // forward/left + sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, 0.7f, m_AvoidanceLayers)); // forward/left/left + sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1.5f, maxSpeed * 0.9f, m_AvoidanceLayers)); // forward/forward/right + sensors.Add(new Sensor(transform.forward + transform.right, 1f, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/right + sensors.Add(new Sensor(transform.forward + transform.right * 2, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right/right sensors.Add(new Sensor(-transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // left sensors.Add(new Sensor(transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // right @@ -240,7 +245,7 @@ private void ConfigureSensors() sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.1f, m_AvoidanceLayers)); // down sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/left - sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.3f, m_AvoidanceLayers)); // down/forward sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/right sensorArray = sensors.ToArray(); } @@ -259,7 +264,8 @@ Vector3 GetRepulsionDirection() Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { - if (destination.position.y < rb.position.y && sensorArray[i].sensorDirection.y < 0) + if (GetDestinationPointAdjustedForApproachHeight().y < rb.position.y + && sensorArray[i].sensorDirection.y < 0) { // skip downward sensors as they would result in a push back up as we are trying to go down. // note that forward and up sensors can still result in a small upward force depending on @@ -271,7 +277,7 @@ Vector3 GetRepulsionDirection() return strength * Mathf.Clamp(strength.magnitude, 0, m_MaxAvoidanceLength); } - private void Start() + void Start() { if (m_Animator) { @@ -331,7 +337,6 @@ private void LandingPhysics() { rb.freezeRotation = true; - // gravity is in effect so just wait if (height < m_GroundedHeight) { isLanding = false; @@ -341,7 +346,7 @@ private void LandingPhysics() Vector3 desiredDirection; Vector3 interimDestination = GetDestinationPointAdjustedForApproachHeight(); - + desiredDirection = (interimDestination - rb.position); Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) @@ -369,6 +374,7 @@ private void LandingPhysics() private void FlightPhysics() { + m_Agent.enabled = false; rb.freezeRotation = false; Vector3 desiredDirection; @@ -414,7 +420,7 @@ private void FlightPhysics() } /// - /// Create an interim point that is in the same x,z space as the destination but adjusted for height + /// Get an interim point that is in the same x,z space as the destination but adjusted for height /// to provide a good approach for landing or leisurely flight. /// private Vector3 GetDestinationPointAdjustedForApproachHeight() @@ -425,11 +431,11 @@ private Vector3 GetDestinationPointAdjustedForApproachHeight() { if (height > m_OptimalHeight) { - interimDestination.y = Mathf.Lerp(m_OptimalHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + interimDestination.y = Mathf.Lerp(m_OptimalHeight + destination.position.y, destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); } else { - interimDestination.y = Mathf.Lerp(height + destination.position.y, m_OptimalHeight + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + interimDestination.y = Mathf.Lerp(destination.position.y, m_OptimalHeight + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); } } else if (m_AutoLand && desiredDirection.sqrMagnitude > prepareToLandDistanceSqr) @@ -499,6 +505,7 @@ private void TakeOff() /// private void GroundMovement() { + m_Agent.enabled = true; rb.freezeRotation = true; if (Random.value < 0.01) { @@ -530,7 +537,7 @@ void SetAnimationParameters() float forwardVelocity = transform.InverseTransformDirection(rb.velocity).normalized.z; bool glide = false; - if (forwardVelocity > 0.9) + if (forwardVelocity > 0.9 && height > m_MinHeight) { glide = pitch > -0.2 && pitch < 0.2; } From 3b32cd7daa1d38aab6f07b95c4801dbb592822d8 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 21 Feb 2022 11:58:44 -0800 Subject: [PATCH 19/36] Land and stay on the ground for a minimum amount of time. --- Animations/DragonController.controller | 362 ++++++++++-------- Prefabs/Large Creature Waypoint.prefab | 2 +- Scripts/Runtime/MoveToWaypoint.cs | 3 +- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 25 +- 4 files changed, 228 insertions(+), 164 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 3d36ee6..3be1ad3 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -121,28 +121,6 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 ---- !u!1101 &-6409865991935553825 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 5390586394938884688} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.45 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!206 &-6390963665721911578 BlendTree: m_ObjectHideFlags: 1 @@ -206,6 +184,31 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1101 &-6208041322058734085 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: -3192933728264777258} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1102 &-6062263935054202883 AnimatorState: serializedVersion: 6 @@ -234,23 +237,34 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: ---- !u!1109 &-4678224719129570272 -AnimatorTransition: +--- !u!1102 &-4998510795023692726 +AnimatorState: + serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 3 - m_ConditionEvent: forwardVelocity - m_EventTreshold: 0.05 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1368909181614760674} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 1 + m_Name: Take Off + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 7690465360124435592} + - {fileID: -6208041322058734085} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: -3483190475960587025} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!1101 &-4113568117264443117 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -276,28 +290,72 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1101 &-4026105901526405743 -AnimatorStateTransition: +--- !u!1102 &-3696853045062049746 +AnimatorState: + serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: -6062263935054202883} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_Name: Fly + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -1988443606807587019} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &-3483190475960587025 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 3adb37226d2cc804cbf549b0e919170d, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 0f76f6d3b2f7b0e43932781861d8af17, type: 2} + m_Threshold: 0.3 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: b1bf5eb05923a6240afc3dfe8dc03d5f, type: 2} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: forwardVelocity + m_BlendParameterY: roll + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 --- !u!1107 &-3305796469165601778 AnimatorStateMachine: serializedVersion: 6 @@ -313,12 +371,6 @@ AnimatorStateMachine: - serializedVersion: 1 m_State: {fileID: 8818472427370911743} m_Position: {x: 780, y: 130, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1368909181614760674} - m_Position: {x: 460, y: -140, z: 0} - - serializedVersion: 1 - m_State: {fileID: 5390586394938884688} - m_Position: {x: 460, y: 0, z: 0} - serializedVersion: 1 m_State: {fileID: -8188205827486385974} m_Position: {x: 460, y: 310, z: 0} @@ -330,7 +382,7 @@ AnimatorStateMachine: m_AnyStatePosition: {x: 50, y: 20, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 820, y: 320, z: 0} - m_ParentStateMachinePosition: {x: 160, y: 250, z: 0} + m_ParentStateMachinePosition: {x: 160, y: 230, z: 0} m_DefaultState: {fileID: -6062263935054202883} --- !u!1107 &-3192933728264777258 AnimatorStateMachine: @@ -362,23 +414,29 @@ AnimatorStateMachine: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Base Layer - m_ChildStates: [] + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -4998510795023692726} + m_Position: {x: 270, y: 290, z: 0} + - serializedVersion: 1 + m_State: {fileID: -3696853045062049746} + m_Position: {x: 270, y: 430, z: 0} m_ChildStateMachines: - serializedVersion: 1 m_StateMachine: {fileID: -3192933728264777258} m_Position: {x: 410, y: 120, z: 0} - serializedVersion: 1 m_StateMachine: {fileID: -3305796469165601778} - m_Position: {x: 410, y: 260, z: 0} + m_Position: {x: 410, y: 570, z: 0} m_AnyStateTransitions: [] m_EntryTransitions: [] m_StateMachineTransitions: - first: {fileID: -3192933728264777258} second: - - {fileID: -4678224719129570272} + - {fileID: 1909334267643847070} m_StateMachineBehaviours: [] m_AnyStatePosition: {x: 50, y: 20, z: 0} - m_EntryPosition: {x: 50, y: 120, z: 0} + m_EntryPosition: {x: 40, y: 160, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_DefaultState: {fileID: 4508942873295745061} @@ -407,6 +465,28 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 +--- !u!1101 &-1988443606807587019 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -6062263935054202883} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1101 &-840008826692192264 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -527,33 +607,26 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} ---- !u!1102 &1368909181614760674 -AnimatorState: - serializedVersion: 6 +--- !u!1109 &1909334267643847070 +AnimatorTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Take Off - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: -6409865991935553825} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 5762736684047287387} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: + m_Name: + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: forwardVelocity + m_EventTreshold: 0.05 + - m_ConditionMode: 2 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -4998510795023692726} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 --- !u!206 &1940849809455141935 BlendTree: m_ObjectHideFlags: 1 @@ -663,7 +736,10 @@ AnimatorStateTransition: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: - m_Conditions: [] + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 4508942873295745061} m_Solo: 0 @@ -678,6 +754,28 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 +--- !u!1101 &3922406552934577057 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -6062263935054202883} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1102 &4508942873295745061 AnimatorState: serializedVersion: 6 @@ -802,72 +900,6 @@ BlendTree: m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1102 &5390586394938884688 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Fly - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: -4026105901526405743} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!206 &5762736684047287387 -BlendTree: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Blend Tree - m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 3adb37226d2cc804cbf549b0e919170d, type: 2} - m_Threshold: 0 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 0f76f6d3b2f7b0e43932781861d8af17, type: 2} - m_Threshold: 0.3 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: b1bf5eb05923a6240afc3dfe8dc03d5f, type: 2} - m_Threshold: 1 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - m_BlendParameter: forwardVelocity - m_BlendParameterY: roll - m_MinThreshold: 0 - m_MaxThreshold: 1 - m_UseAutomaticThresholds: 0 - m_NormalizedBlendValues: 0 - m_BlendType: 0 --- !u!206 &6311787111152291628 BlendTree: m_ObjectHideFlags: 1 @@ -1041,6 +1073,28 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1101 &7690465360124435592 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -3696853045062049746} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.45 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1109 &7746444506946679310 AnimatorTransition: m_ObjectHideFlags: 1 diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 4ffadec..1c54482 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -41,7 +41,7 @@ SphereCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146072} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Radius: 0.01 diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 338c017..135ef17 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -144,9 +144,8 @@ bool IsStuck { get { - if (m_SteeringRig.isLanding) return false; + if (!m_SteeringRig.isFlying) return false; if (m_SteeringRig.isIdle) return false; - if (m_SteeringRig.isTakingOff) return false; if (Vector3.SqrMagnitude(oldPosition - transform.position) < sqrStuckTolerance) { diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 0070ac7..f3f889b 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using static WizardsCode.AI.Sensor; using WizardsCode.Character; +using System; +using Random = UnityEngine.Random; namespace WizardsCode.AI { @@ -43,6 +45,8 @@ public class FlyingSteeringRig : BaseActorController [SerializeField, Tooltip("The height above the ground or nearest obstacle that will cause this rig" + " automatically land.")] float m_LandingHeight = 0.5f; + [SerializeField, Tooltip("The minimum amount of time to spend on the ground after landing. The Dragon will not take off again until this amount of time (in seconds) has passed.")] + float m_MinTimeOnGround = 5; [SerializeField, Tooltip("The height at which the body is considered to be grounded. Theoretically this should be zero," + " however it will often be higher due to the models structure.")] float m_GroundedHeight = 0.08f; @@ -120,6 +124,8 @@ public bool isGrounded } } + private float m_TimeOfLastLanding; + /// /// Returns true if the body is in the process of taking off. /// @@ -313,7 +319,8 @@ protected virtual void FixedUpdate() if (isGrounded) { - if (destination.position.y >= height + m_MinHeight) + // FIXME: need height of destination from the ground not absolute height + if (destination.position.y >= height + m_MinHeight && m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad) { TakeOff(); } @@ -341,6 +348,7 @@ private void LandingPhysics() { isLanding = false; isGrounded = true; + m_TimeOfLastLanding = Time.timeSinceLevelLoad; return; } @@ -442,22 +450,22 @@ private Vector3 GetDestinationPointAdjustedForApproachHeight() { if (height > m_MinHeight) { - interimDestination.y = Mathf.Lerp(m_MinHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); + interimDestination.y = Mathf.Lerp(m_MinHeight + destination.position.y, destination.position.y, desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); } else { - interimDestination.y = Mathf.Lerp(destination.position.y + destination.position.y, m_MinHeight , desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); + interimDestination.y = Mathf.Lerp(destination.position.y, m_MinHeight , desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); } } else if (m_AutoLand && desiredDirection.sqrMagnitude > landingDistanceSqr) { if (height > m_LandingHeight) { - interimDestination.y = Mathf.Lerp(height + destination.position.y, m_LandingHeight + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); + interimDestination.y = Mathf.Lerp(destination.position.y, m_LandingHeight + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); } else { - interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y, height + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); + interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y,destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); } } else if (m_AutoLand && destination.position.y < m_LandingHeight) @@ -508,10 +516,12 @@ private void GroundMovement() m_Agent.enabled = true; rb.freezeRotation = true; - if (Random.value < 0.01) { - // FIXME: Add ground movement + if (m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad && Random.value <= 0.01) { TakeOff(); + return; } + + throw new NotImplementedException("Add ground movement logic."); } void SetAnimationParameters() { @@ -559,6 +569,7 @@ void SetAnimationParameters() private void OnDrawGizmosSelected() { if (destination == null) return; + if (isGrounded) return; // Target Direction Gizmos.color = Color.yellow; From a894e03016f0171563d5ce82620b1315c0c79bcb Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 21 Feb 2022 18:38:57 -0800 Subject: [PATCH 20/36] Landing and Take off now works - polish needed --- Animations/DragonController.controller | 456 +++++++++++------- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 40 +- 2 files changed, 325 insertions(+), 171 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 3be1ad3..e04ee1c 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -74,7 +74,7 @@ AnimatorState: m_Speed: 1 m_CycleOffset: 0 m_Transitions: - - {fileID: 3805648157650597287} + - {fileID: 235655049629258357} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -90,6 +90,33 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1102 &-7148949229824281150 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ground Movement + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 4656374160036315861} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: -5995950608809702562} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!206 &-6416401713070107847 BlendTree: m_ObjectHideFlags: 1 @@ -99,7 +126,7 @@ BlendTree: m_Name: Blend Tree m_Childs: - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: c66c9d973a8b47d4f8a5a4d74b1d829e, type: 2} + m_Motion: {fileID: 7400000, guid: f5d454fc50ce1484880e8f911121b98a, type: 2} m_Threshold: 0.4 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -107,7 +134,7 @@ BlendTree: m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 8ea768a6df46eff42ada5fb9df91c44f, type: 2} + m_Motion: {fileID: 7400000, guid: 20054dc4b8f9f5f469721d3fe60a42fe, type: 2} m_Threshold: 1 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -184,31 +211,6 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 ---- !u!1101 &-6208041322058734085 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 1 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 - m_DstStateMachine: {fileID: -3192933728264777258} - m_DstState: {fileID: 0} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 0 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!1102 &-6062263935054202883 AnimatorState: serializedVersion: 6 @@ -237,6 +239,141 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!206 &-5995950608809702562 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 22c6db7ffbcac17489bfe3f4d0dc9cae, type: 2} + m_Threshold: 0.06666667 + m_Position: {x: -1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 7cdeec84aabad554b86d26fc01bcba7b, type: 2} + m_Threshold: 0.13333334 + m_Position: {x: 1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 0721403aa50e57b4ab6dfac45dd4f34d, type: 2} + m_Threshold: 0.20000002 + m_Position: {x: -1, y: 0.3} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 42cd61671c82bd64d81c44a53d73595a, type: 2} + m_Threshold: 0.26666668 + m_Position: {x: -1, y: 0.7} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 5f0d1563c229c824891d9f9567b353ab, type: 2} + m_Threshold: 0.33333334 + m_Position: {x: 0, y: 0.4} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 100961df248c7604cb67cb9a391e54ba, type: 2} + m_Threshold: 0.4 + m_Position: {x: 0, y: 0.7} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 77f9c829e773f0644a17356e9aaeb508, type: 2} + m_Threshold: 0.46666667 + m_Position: {x: 1, y: 0.3} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 1327632a62d23564ca82127131560da3, type: 2} + m_Threshold: 0.53333336 + m_Position: {x: 1, y: 0.7} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 2d9e6064dadac784f902292c4d312940, type: 2} + m_Threshold: 0.6 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 8e50f84997e770343a72fc6a9912d0de, type: 2} + m_Threshold: 0.6666667 + m_Position: {x: 0, y: -1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 4e299ae506296c24c89c59fa182cd3e9, type: 2} + m_Threshold: 0.73333335 + m_Position: {x: -1, y: -0.5} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 63dc492264e72ab45884d3d16e7b17e7, type: 2} + m_Threshold: 0.8 + m_Position: {x: 1, y: -0.5} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: e18a90b540cd0174d80f7c196459c077, type: 2} + m_Threshold: 0.8666667 + m_Position: {x: -1, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 31bfc5ba291e8e541b3ed0effe9a56e1, type: 2} + m_Threshold: 0.93333334 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 7fb613f09f192494baf5938f9750dcea, type: 2} + m_Threshold: 1 + m_Position: {x: 1, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + m_BlendParameter: turn + m_BlendParameterY: forward + m_MinThreshold: 0.06666667 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 2 --- !u!1102 &-4998510795023692726 AnimatorState: serializedVersion: 6 @@ -249,7 +386,7 @@ AnimatorState: m_CycleOffset: 0 m_Transitions: - {fileID: 7690465360124435592} - - {fileID: -6208041322058734085} + - {fileID: 513107367667273169} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 @@ -384,28 +521,6 @@ AnimatorStateMachine: m_ExitPosition: {x: 820, y: 320, z: 0} m_ParentStateMachinePosition: {x: 160, y: 230, z: 0} m_DefaultState: {fileID: -6062263935054202883} ---- !u!1107 &-3192933728264777258 -AnimatorStateMachine: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Idle - m_ChildStates: - - serializedVersion: 1 - m_State: {fileID: 4508942873295745061} - m_Position: {x: 410, y: 110, z: 0} - m_ChildStateMachines: [] - m_AnyStateTransitions: [] - m_EntryTransitions: [] - m_StateMachineTransitions: {} - m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 50, y: 20, z: 0} - m_EntryPosition: {x: 50, y: 120, z: 0} - m_ExitPosition: {x: 800, y: 120, z: 0} - m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 4508942873295745061} --- !u!1107 &-2323046387310864844 AnimatorStateMachine: serializedVersion: 6 @@ -417,29 +532,31 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: -4998510795023692726} - m_Position: {x: 270, y: 290, z: 0} + m_Position: {x: 270, y: 190, z: 0} - serializedVersion: 1 m_State: {fileID: -3696853045062049746} m_Position: {x: 270, y: 430, z: 0} m_ChildStateMachines: - - serializedVersion: 1 - m_StateMachine: {fileID: -3192933728264777258} - m_Position: {x: 410, y: 120, z: 0} - serializedVersion: 1 m_StateMachine: {fileID: -3305796469165601778} - m_Position: {x: 410, y: 570, z: 0} + m_Position: {x: 550, y: 440, z: 0} + - serializedVersion: 1 + m_StateMachine: {fileID: 2881775655748264109} + m_Position: {x: 270, y: 70, z: 0} m_AnyStateTransitions: [] m_EntryTransitions: [] m_StateMachineTransitions: - - first: {fileID: -3192933728264777258} + - first: {fileID: 2881775655748264109} second: - - {fileID: 1909334267643847070} + - {fileID: -298753130373294560} + - first: {fileID: -3305796469165601778} + second: [] m_StateMachineBehaviours: [] m_AnyStatePosition: {x: 50, y: 20, z: 0} - m_EntryPosition: {x: 40, y: 160, z: 0} + m_EntryPosition: {x: 30, y: 190, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 4508942873295745061} + m_DefaultState: {fileID: -7148949229824281150} --- !u!1101 &-2175759424970179939 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -487,31 +604,23 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1101 &-840008826692192264 -AnimatorStateTransition: +--- !u!1109 &-298753130373294560 +AnimatorTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: m_Conditions: - - m_ConditionMode: 3 - m_ConditionEvent: forwardVelocity - m_EventTreshold: 0.05 + - m_ConditionMode: 1 + m_ConditionEvent: isTakingOff + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 0} + m_DstState: {fileID: -4998510795023692726} m_Solo: 0 m_Mute: 0 - m_IsExit: 1 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 0 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_IsExit: 0 + serializedVersion: 1 --- !u!1101 &-40628600873809189 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -551,49 +660,67 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} + - m_Name: isTakingOff + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: forwardVelocity m_Type: 1 - m_DefaultFloat: 1 + m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} + - m_Name: turn + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: forward + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -607,26 +734,56 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} ---- !u!1109 &1909334267643847070 -AnimatorTransition: +--- !u!1101 &235655049629258357 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 0} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &513107367667273169 +AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: m_Conditions: - - m_ConditionMode: 3 - m_ConditionEvent: forwardVelocity - m_EventTreshold: 0.05 - - m_ConditionMode: 2 + - m_ConditionMode: 1 m_ConditionEvent: isGrounded m_EventTreshold: 0 + - m_ConditionMode: 2 + m_ConditionEvent: isTakingOff + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: -4998510795023692726} + m_DstState: {fileID: -7148949229824281150} m_Solo: 0 m_Mute: 0 m_IsExit: 0 - serializedVersion: 1 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!206 &1940849809455141935 BlendTree: m_ObjectHideFlags: 1 @@ -636,8 +793,16 @@ BlendTree: m_Name: Fly Down m_Childs: - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} + m_Motion: {fileID: 7400000, guid: e2f236372fdbf904ab33d126c4da79b9, type: 2} m_Threshold: 13 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: roll + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} + m_Threshold: 18 m_Position: {x: -0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -645,7 +810,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8355f35815429be48b4719939f7c92ae, type: 2} - m_Threshold: 18 + m_Threshold: 23 m_Position: {x: 0, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -653,7 +818,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} - m_Threshold: 23 + m_Threshold: 28 m_Position: {x: 0.5, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 @@ -661,7 +826,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} - m_Threshold: 28 + m_Threshold: 33 m_Position: {x: -0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 @@ -669,7 +834,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 5cc910c66b70fb04284254469d04f532, type: 2} - m_Threshold: 33 + m_Threshold: 38 m_Position: {x: 0, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 @@ -677,7 +842,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: b9df435da0377284ca1a151b641cf1d3, type: 2} - m_Threshold: 38 + m_Threshold: 43 m_Position: {x: 0.7, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 @@ -686,7 +851,7 @@ BlendTree: m_BlendParameter: yaw m_BlendParameterY: verticalVelocity m_MinThreshold: 13 - m_MaxThreshold: 38 + m_MaxThreshold: 43 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 @@ -729,31 +894,28 @@ BlendTree: m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 0 ---- !u!1101 &3805648157650597287 -AnimatorStateTransition: +--- !u!1107 &2881775655748264109 +AnimatorStateMachine: + serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 1 - m_ConditionEvent: isGrounded - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 4508942873295745061} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 0.6666666 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_Name: Ground Movement + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -7148949229824281150} + m_Position: {x: 420, y: 110, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 420, y: -100, z: 0} + m_DefaultState: {fileID: -7148949229824281150} --- !u!1101 &3922406552934577057 AnimatorStateTransition: m_ObjectHideFlags: 1 @@ -776,35 +938,7 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1102 &4508942873295745061 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Idle - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 4891491047935572450} - - {fileID: -840008826692192264} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: ffef967343d4cb74ebc5c4f9a520cb1e, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1101 &4891491047935572450 +--- !u!1101 &4656374160036315861 AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} @@ -812,18 +946,18 @@ AnimatorStateTransition: m_PrefabAsset: {fileID: 0} m_Name: m_Conditions: - - m_ConditionMode: 4 - m_ConditionEvent: forwardVelocity - m_EventTreshold: 0.05 + - m_ConditionMode: 1 + m_ConditionEvent: isTakingOff + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 0} + m_DstState: {fileID: -4998510795023692726} m_Solo: 0 m_Mute: 0 - m_IsExit: 1 + m_IsExit: 0 serializedVersion: 3 m_TransitionDuration: 0.25 m_TransitionOffset: 0 - m_ExitTime: 0.75 + m_ExitTime: 0.840824 m_HasExitTime: 0 m_HasFixedDuration: 1 m_InterruptionSource: 0 @@ -1036,7 +1170,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} - m_Threshold: 22 + m_Threshold: 26 m_Position: {x: 0.5, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -1044,7 +1178,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} - m_Threshold: 26 + m_Threshold: 30 m_Position: {x: -0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 @@ -1052,7 +1186,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} - m_Threshold: 30 + m_Threshold: 34 m_Position: {x: 0, y: 0.8} m_TimeScale: 1 m_CycleOffset: 0 @@ -1060,7 +1194,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} - m_Threshold: 34 + m_Threshold: 38 m_Position: {x: 0.7, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 @@ -1069,7 +1203,7 @@ BlendTree: m_BlendParameter: yaw m_BlendParameterY: pitch m_MinThreshold: 14 - m_MaxThreshold: 34 + m_MaxThreshold: 38 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 m_BlendType: 3 diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index f3f889b..3c6d865 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -12,7 +12,7 @@ namespace WizardsCode.AI /// This rig provides a 3D navigation for flying creatures and objects. It detects opstacles on the expected path an flies over /// them or around them if it can. /// - public class FlyingSteeringRig : BaseActorController + public class FlyingSteeringRig : AnimatorActorController { #region Inspector Parameters [Header("Flight Controls")] @@ -119,6 +119,11 @@ public bool isGrounded { if (m_Animator && isGrounded != value) { + m_Agent.enabled = value; + if (value) + { + m_Agent.Warp(transform.position); + } m_Animator.SetBool(AnimationHash.isGrounded, value); } } @@ -135,12 +140,19 @@ public bool isTakingOff { if (m_Animator) { - return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.takeOffState; + return m_Animator.GetBool(AnimationHash.isTakingOff); } else { return false; } } + set + { + if (m_Animator) + { + m_Animator.SetBool(AnimationHash.isTakingOff, value); + } + } } /// @@ -214,8 +226,7 @@ protected override void Awake() protected override void Update() { - // FIXME: this overrides BaseActorController, so that we can use it in Ink directions. - // However, we currently override Update meaning none of the features of the base controller are enabled - is this a problem? + if (isGrounded) base.Update(); } public override void MoveTo(Transform destination) @@ -233,7 +244,7 @@ public override void MoveTo(Transform destination) private void ConfigureSensors() { List sensors = new List(); - sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, 1, m_AvoidanceLayers)); // forward + sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, 1, m_AvoidanceLayers)); // near forward sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1.5f, maxSpeed * 0.6f, 0.9f, m_AvoidanceLayers)); // forward/forward/left sensors.Add(new Sensor(transform.forward - transform.right, 1f, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // forward/left sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, 0.7f, m_AvoidanceLayers)); // forward/left/left @@ -328,6 +339,12 @@ protected virtual void FixedUpdate() { GroundMovement(); } + } + else if (isTakingOff) + { + // Take off is handled in the animation controller, so once we are flying we are good. + isTakingOff = height < m_LandingHeight; + FlightPhysics(); } else if (isLanding) { @@ -382,7 +399,6 @@ private void LandingPhysics() private void FlightPhysics() { - m_Agent.enabled = false; rb.freezeRotation = false; Vector3 desiredDirection; @@ -504,6 +520,7 @@ private void TakeOff() Vector3 moveDirection = Vector3.zero; moveDirection = new Vector3(0, 1000, 1000); isGrounded = false; + isTakingOff = true; ApplyForces(moveDirection); } @@ -513,7 +530,6 @@ private void TakeOff() /// private void GroundMovement() { - m_Agent.enabled = true; rb.freezeRotation = true; if (m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad && Random.value <= 0.01) { @@ -521,7 +537,10 @@ private void GroundMovement() return; } - throw new NotImplementedException("Add ground movement logic."); + if (m_Agent.destination != destination.position) + { + m_Agent.SetDestination(destination.position); + } } void SetAnimationParameters() { @@ -530,7 +549,7 @@ void SetAnimationParameters() Quaternion q = rb.rotation; float rollRad = Mathf.Atan2(2 * q.y * q.w - 2 * q.x * q.z, 1 - 2 * q.y * q.y - 2 * q.z * q.z); float pitchRad = Mathf.Atan2(2 * q.x * q.w - 2 * q.y * q.z, 1 - 2 * q.x * q.x - 2 * q.z * q.z); - //float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); + float yawRad = Mathf.Asin(2 * q.x * q.y + 2 * q.z * q.w); float pitch; if (pitchRad <= 0) // up @@ -540,7 +559,7 @@ void SetAnimationParameters() { pitch = (Mathf.Rad2Deg * -pitchRad) / m_MaxDiveAngle; } - //float yaw = yawRad / 1.52f; + float yaw = yawRad / 1.52f; float roll = rollRad / 3.14f; float strafeVelocity = transform.InverseTransformDirection(rb.velocity).normalized.x; float verticalVelocity = rb.velocity.normalized.y; @@ -699,6 +718,7 @@ internal static class AnimationHash { #region parameters internal static int isGrounded = Animator.StringToHash("isGrounded"); + internal static int isTakingOff= Animator.StringToHash("isTakingOff"); internal static int isLanding = Animator.StringToHash("isLanding"); internal static int roll = Animator.StringToHash("roll"); From c83d285d42212615dbbf5835ff88ba002c325b62 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Mon, 21 Feb 2022 23:09:07 -0800 Subject: [PATCH 21/36] A little more tuning of dragon navigation and take off/landing --- Animations/DragonController.controller | 6 +-- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 41 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index e04ee1c..92cf127 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -463,7 +463,7 @@ BlendTree: m_Name: Blend Tree m_Childs: - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: 3adb37226d2cc804cbf549b0e919170d, type: 2} + m_Motion: {fileID: 7400000, guid: ae03bdbfa4f8697459f82ce14835189f, type: 2} m_Threshold: 0 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -479,7 +479,7 @@ BlendTree: m_DirectBlendParameter: roll m_Mirror: 0 - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: b1bf5eb05923a6240afc3dfe8dc03d5f, type: 2} + m_Motion: {fileID: 7400000, guid: 478c730bfd3c1534ca86b78e66dabdbe, type: 2} m_Threshold: 1 m_Position: {x: 0, y: 0} m_TimeScale: 1 @@ -532,7 +532,7 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: -4998510795023692726} - m_Position: {x: 270, y: 190, z: 0} + m_Position: {x: 270, y: 260, z: 0} - serializedVersion: 1 m_State: {fileID: -3696853045062049746} m_Position: {x: 270, y: 430, z: 0} diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 3c6d865..765a64c 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -256,31 +256,43 @@ private void ConfigureSensors() sensors.Add(new Sensor(transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // right sensors.Add(new Sensor(transform.up, 0, maxSpeed * 0.5f, m_AvoidanceLayers)); // up - sensors.Add(new Sensor(transform.up + transform.forward, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/forward - sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/left - sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // up/right + sensors.Add(new Sensor(transform.up + transform.forward, 0, maxSpeed * 1.5f, 1.0f, m_AvoidanceLayers)); // up/forward + sensors.Add(new Sensor(transform.up + transform.forward * 2, 0, maxSpeed * 1.5f, 1.0f, m_AvoidanceLayers)); // up/forward/forward + sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/left + sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/right sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.1f, m_AvoidanceLayers)); // down - sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/left - sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.3f, m_AvoidanceLayers)); // down/forward - sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.6f, 0.3f, m_AvoidanceLayers)); // down/right + sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.4f, 0.3f, m_AvoidanceLayers)); // down/left + sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.4f, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up + transform.forward * 2, 0, m_MinHeight * 2, 0.2f, m_AvoidanceLayers)); // down/forward/forward + sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.6f, 0.4f, m_AvoidanceLayers)); // down/right sensorArray = sensors.ToArray(); } /// /// Get a direction that will push the object away from detected obstacles. + /// + /// If true then all sensors will be updated immediately. Use this if you need very accurate avoidance. Othersie leave as the default false. /// - Vector3 GetRepulsionDirection() + Vector3 GetRepulsionDirection(bool updateAllSensors = false) { if (isLanding) return Vector3.zero; - sensorArray[nextSensorToPulse].Pulse(this); - nextSensorToPulse++; - if (nextSensorToPulse == sensorArray.Length) nextSensorToPulse = 0; + if (!updateAllSensors) + { + sensorArray[nextSensorToPulse].Pulse(this); + nextSensorToPulse++; + if (nextSensorToPulse == sensorArray.Length) nextSensorToPulse = 0; + } Vector3 strength = Vector3.zero; for (int i = 0; i < sensorArray.Length; i++) { + if (updateAllSensors) + { + sensorArray[i].Pulse(this); + } + if (GetDestinationPointAdjustedForApproachHeight().y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { @@ -515,6 +527,11 @@ private void ApplyForces(Vector3 moveDirection) /// private void TakeOff() { + Vector3 repulsion = GetRepulsionDirection(true); + if (repulsion.y < 0) { + return; + } + rb.freezeRotation = false; Vector3 moveDirection = Vector3.zero; @@ -601,10 +618,6 @@ private void OnDrawGizmosSelected() { for (int i = 0; i < sensorArray.Length; i++) { - if (destination.position.y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { - continue; - } - Vector3 direction = rb.transform.TransformDirection(sensorArray[i].sensorDirection); float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); From 96966cbed5b31d4ded6cd462b05fe411f9420b97 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Tue, 22 Feb 2022 07:41:04 -0800 Subject: [PATCH 22/36] Smooth out the flight a little - less jerking upwards when gravity is taking hold --- Animations/DragonController.controller | 84 +++++++++++-------- Prefabs/Large Creature Waypoint.prefab | 2 +- Prefabs/Waypoint.prefab | 2 +- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 17 ++-- 4 files changed, 60 insertions(+), 45 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 92cf127..293c965 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -539,18 +539,19 @@ AnimatorStateMachine: m_ChildStateMachines: - serializedVersion: 1 m_StateMachine: {fileID: -3305796469165601778} - m_Position: {x: 550, y: 440, z: 0} + m_Position: {x: 630, y: 420, z: 0} - serializedVersion: 1 m_StateMachine: {fileID: 2881775655748264109} - m_Position: {x: 270, y: 70, z: 0} + m_Position: {x: 430, y: 60, z: 0} m_AnyStateTransitions: [] m_EntryTransitions: [] m_StateMachineTransitions: + - first: {fileID: -3305796469165601778} + second: + - {fileID: 6010986857719939538} - first: {fileID: 2881775655748264109} second: - {fileID: -298753130373294560} - - first: {fileID: -3305796469165601778} - second: [] m_StateMachineBehaviours: [] m_AnyStatePosition: {x: 50, y: 20, z: 0} m_EntryPosition: {x: 30, y: 190, z: 0} @@ -660,67 +661,67 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: isTakingOff m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: forwardVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: turn m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: forward m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -792,18 +793,10 @@ BlendTree: m_PrefabAsset: {fileID: 0} m_Name: Fly Down m_Childs: - - serializedVersion: 2 - m_Motion: {fileID: 7400000, guid: e2f236372fdbf904ab33d126c4da79b9, type: 2} - m_Threshold: 13 - m_Position: {x: 0, y: 0} - m_TimeScale: 1 - m_CycleOffset: 0 - m_DirectBlendParameter: roll - m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: baa36b7c17a4288439f4e20dd5e8e798, type: 2} m_Threshold: 18 - m_Position: {x: -0.5, y: -0.2} + m_Position: {x: -0.35, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -819,7 +812,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 2c46f8b459a2e39489ad33e0c25e45e4, type: 2} m_Threshold: 28 - m_Position: {x: 0.5, y: -0.2} + m_Position: {x: 0.35, y: -0.2} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -827,7 +820,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 865afa414143d9b4dbb47938baa15854, type: 2} m_Threshold: 33 - m_Position: {x: -0.7, y: -0.8} + m_Position: {x: -0.6, y: -0.8} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -850,7 +843,7 @@ BlendTree: m_Mirror: 0 m_BlendParameter: yaw m_BlendParameterY: verticalVelocity - m_MinThreshold: 13 + m_MinThreshold: 18 m_MaxThreshold: 43 m_UseAutomaticThresholds: 0 m_NormalizedBlendValues: 0 @@ -873,7 +866,7 @@ BlendTree: m_Mirror: 0 - serializedVersion: 2 m_Motion: {fileID: 6334421064192970886} - m_Threshold: 0.4 + m_Threshold: 0.3 m_Position: {x: 0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 @@ -1034,6 +1027,23 @@ BlendTree: m_UseAutomaticThresholds: 1 m_NormalizedBlendValues: 0 m_BlendType: 3 +--- !u!1109 &6010986857719939538 +AnimatorTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isGrounded + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -7148949229824281150} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 1 --- !u!206 &6311787111152291628 BlendTree: m_ObjectHideFlags: 1 @@ -1084,7 +1094,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 0.2 - m_Position: {x: -0.6, y: 0.4} + m_Position: {x: -0.4, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1092,7 +1102,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Threshold: 0.2979592 - m_Position: {x: 0, y: 0.5} + m_Position: {x: 0.099, y: 0.513} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1100,7 +1110,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} m_Threshold: 0.39591837 - m_Position: {x: 0.6, y: 0.4} + m_Position: {x: 0.4, y: 0.4} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1108,7 +1118,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 0b47b571577c971449a4f1f5d234b2fb, type: 2} m_Threshold: 0.4938776 - m_Position: {x: -0.4, y: 0} + m_Position: {x: -0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1124,7 +1134,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 7e26352eb41642447820642ab5e48ea5, type: 2} m_Threshold: 0.689796 - m_Position: {x: 0.4, y: 0} + m_Position: {x: 0.2, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1155,7 +1165,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: cc9cbc5b07c4f5d4ebee64760b87f7ab, type: 2} m_Threshold: 14 - m_Position: {x: -0.5, y: 0} + m_Position: {x: -0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1171,7 +1181,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: ba3ade90af933bc4ea3f02fa11877300, type: 2} m_Threshold: 26 - m_Position: {x: 0.5, y: 0} + m_Position: {x: 0.4, y: 0} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1179,7 +1189,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} m_Threshold: 30 - m_Position: {x: -0.7, y: 0.7} + m_Position: {x: -0.65, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1195,7 +1205,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_Threshold: 38 - m_Position: {x: 0.7, y: 0.7} + m_Position: {x: 0.65, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 1c54482..1da848f 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -11,7 +11,7 @@ GameObject: - component: {fileID: 434040} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 0 + m_Layer: 31 m_Name: Large Creature Waypoint m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index f0e8810..bd42a1b 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -11,7 +11,7 @@ GameObject: - component: {fileID: 434040} - component: {fileID: 5192126769102148771} - component: {fileID: 6907383477543755845} - m_Layer: 0 + m_Layer: 31 m_Name: Waypoint m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 765a64c..b4e8142 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -130,6 +130,8 @@ public bool isGrounded } private float m_TimeOfLastLanding; + private float previousForwardForce; + private float previousVerticalForce; /// /// Returns true if the body is in the process of taking off. @@ -261,11 +263,11 @@ private void ConfigureSensors() sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/left sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/right - sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight, 0.1f, m_AvoidanceLayers)); // down - sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.4f, 0.3f, m_AvoidanceLayers)); // down/left - sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.4f, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight * 2, 0.1f, m_AvoidanceLayers)); // down + sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.5f, 0.3f, m_AvoidanceLayers)); // down/left + sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.5f, m_AvoidanceLayers)); // down/forward sensors.Add(new Sensor(-transform.up + transform.forward * 2, 0, m_MinHeight * 2, 0.2f, m_AvoidanceLayers)); // down/forward/forward - sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.6f, 0.4f, m_AvoidanceLayers)); // down/right + sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.7f, 0.4f, m_AvoidanceLayers)); // down/right sensorArray = sensors.ToArray(); } @@ -514,9 +516,12 @@ private void ApplyForces(Vector3 moveDirection) // Vertical force to add float verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(moveDirection.normalized.y)); + previousForwardForce = forwardForce; + previousVerticalForce = verticalForce; + // Add the forces - rb.AddForce((forwardForce * moveDirection.normalized) - + (verticalForce * rb.transform.up)); + rb.AddForce((Mathf.Lerp(previousForwardForce, forwardForce, Time.deltaTime) * moveDirection.normalized) + + (Mathf.Lerp(previousVerticalForce, verticalForce, Time.deltaTime) * rb.transform.up)); // Don't go over maximum speed rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed); From d45ab21232c901cd6313072a0a4ea2a96c73c080 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Tue, 22 Feb 2022 08:44:24 -0800 Subject: [PATCH 23/36] If body starts in the air we need to start flying This is crude, but it works. Should really move into flight state directly. --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index b4e8142..add4e7a 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -315,7 +315,12 @@ void Start() originalAnimationSpeed = m_Animator.speed; } - isGrounded = height <= m_GroundedHeight; + if (height <= m_GroundedHeight) { + isGrounded = true; + } else + { + isTakingOff = true; + } isLanding = false; } From 63429f13394c706586dc0dedebc7ac43506d9925 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Tue, 22 Feb 2022 23:55:27 -0800 Subject: [PATCH 24/36] Ensure we never spawn waypoints below ground --- Scripts/Runtime/BoxAreaSpawner.cs | 56 +++++++++++++++++-------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index b555557..941824e 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -172,41 +172,47 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) RaycastHit hit; float height = 0; - bool hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); - if (hasHit) - { - height = hit.distance; + bool hasHit = false; - if (AdjustHeight) + while (!hasHit) + { + hasHit = Physics.Raycast(pos, Vector3.down, out hit, Mathf.Infinity); + if (hasHit) { - if (height + clearance < minHeight) + height = hit.distance; + + if (AdjustHeight) { - pos.y = hit.point.y + minHeight + clearance; + if (height + clearance < minHeight) + { + pos.y = hit.point.y + minHeight + clearance; + } + else if (height + clearance > maxHeight) + { + pos.y = hit.point.y + maxHeight - clearance; + } } - else if (height + clearance > maxHeight) + + if (!SpawnBelowWater) { - pos.y = hit.point.y + maxHeight - clearance; + float waterHeight = hit.distance; + + if (pos.y < waterHeight + clearance) + { + pos.y = waterHeight + clearance; + } + else if (pos.y - waterHeight > maxHeight) + { + pos.y = waterHeight + Random.Range(clearance, maxHeight); + } } } - - if (!SpawnBelowWater) + else { - float waterHeight = hit.distance; - - if (pos.y < waterHeight + clearance) - { - pos.y = waterHeight + clearance; - } - else if (pos.y - waterHeight > maxHeight) - { - pos.y = waterHeight + Random.Range(clearance, maxHeight); - } + Debug.LogError($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Trying again 10 meters higher."); + pos.y += 10; } } - else - { - Debug.LogError($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Relying on the initial spawn positions height."); - } return pos; } From 649b95e224c3bf5752df3cdd889730496641b1d0 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Wed, 23 Feb 2022 00:30:24 -0800 Subject: [PATCH 25/36] use the destination height relative to the terrain for calculating landing flight path Also simplify code I clearly wrote when too tired or maybe even drunk! --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index add4e7a..4c1ac32 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -210,6 +210,31 @@ public float height } } } + + private Transform cachedDestination; + private float cachedDestinationHeight; + /// + /// Returns the height of the current destination relative to the nearest obstacle below it. + /// + public float DestinationHeight + { + get + { + if (cachedDestination != destination) + { + RaycastHit hit; + if (Physics.Raycast(destination.position, Vector3.down, out hit, Mathf.Infinity)) + { + cachedDestinationHeight = hit.distance; + } + else + { + cachedDestinationHeight = 0; + } + } + return cachedDestinationHeight; + } + } protected override void Awake() { base.Awake(); @@ -219,10 +244,10 @@ protected override void Awake() float landingDistance = m_ArrivalDistance * 5f; landingDistanceSqr = landingDistance * landingDistance; - float prepareToLandDistance = landingDistance + (landingDistance * 2f); + float prepareToLandDistance = landingDistance * 4f; prepareToLandDistanceSqr = prepareToLandDistance * prepareToLandDistance; - float approachDistance = prepareToLandDistance + (landingDistance * 5f); + float approachDistance = landingDistance * 6f; approachDistanceSqr = approachDistance * approachDistance; } @@ -295,7 +320,7 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) sensorArray[i].Pulse(this); } - if (GetDestinationPointAdjustedForApproachHeight().y < rb.position.y + if (GetInterimPointAdjustedForApproachHeight().y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { // skip downward sensors as they would result in a push back up as we are trying to go down. @@ -389,7 +414,7 @@ private void LandingPhysics() } Vector3 desiredDirection; - Vector3 interimDestination = GetDestinationPointAdjustedForApproachHeight(); + Vector3 interimDestination = GetInterimPointAdjustedForApproachHeight(); desiredDirection = (interimDestination - rb.position); Vector3 moveDirection = Vector3.zero; @@ -421,7 +446,7 @@ private void FlightPhysics() rb.freezeRotation = false; Vector3 desiredDirection; - Vector3 interimDestination = GetDestinationPointAdjustedForApproachHeight(); + Vector3 interimDestination = GetInterimPointAdjustedForApproachHeight(); desiredDirection = (interimDestination - rb.position); Vector3 moveDirection = Vector3.zero; @@ -466,41 +491,33 @@ private void FlightPhysics() /// Get an interim point that is in the same x,z space as the destination but adjusted for height /// to provide a good approach for landing or leisurely flight. /// - private Vector3 GetDestinationPointAdjustedForApproachHeight() + private Vector3 GetInterimPointAdjustedForApproachHeight() { Vector3 interimDestination = destination.position; Vector3 desiredDirection = (destination.position - rb.position); if (desiredDirection.sqrMagnitude > approachDistanceSqr) { - if (height > m_OptimalHeight) + if (DestinationHeight > m_OptimalHeight) { - interimDestination.y = Mathf.Lerp(m_OptimalHeight + destination.position.y, destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + interimDestination.y = destination.position.y; } else { - interimDestination.y = Mathf.Lerp(destination.position.y, m_OptimalHeight + destination.position.y, desiredDirection.sqrMagnitude / approachDistanceSqr); + interimDestination.y = m_OptimalHeight; } } else if (m_AutoLand && desiredDirection.sqrMagnitude > prepareToLandDistanceSqr) { - if (height > m_MinHeight) - { - interimDestination.y = Mathf.Lerp(m_MinHeight + destination.position.y, destination.position.y, desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); - } - else + if (DestinationHeight < m_MinHeight) { - interimDestination.y = Mathf.Lerp(destination.position.y, m_MinHeight , desiredDirection.sqrMagnitude / prepareToLandDistanceSqr); + interimDestination.y = m_MinHeight; } } else if (m_AutoLand && desiredDirection.sqrMagnitude > landingDistanceSqr) { - if (height > m_LandingHeight) - { - interimDestination.y = Mathf.Lerp(destination.position.y, m_LandingHeight + destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); - } - else + if (DestinationHeight < m_LandingHeight) { - interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y,destination.position.y, desiredDirection.sqrMagnitude / landingDistanceSqr); + interimDestination.y = destination.position.y; } } else if (m_AutoLand && destination.position.y < m_LandingHeight) From 69a72c1c84dc49c82e18ef243f2e0a9d9a110cba Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Thu, 24 Feb 2022 08:10:13 -0800 Subject: [PATCH 26/36] Debounce wingflaps --- Scripts/Runtime/BoxAreaSpawner.cs | 2 +- Scripts/Runtime/SoundController.cs | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index 941824e..b1053ac 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -209,7 +209,7 @@ private Vector3 GetHeightAdjusted(Vector3 pos, WayPoint go) } else { - Debug.LogError($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Trying again 10 meters higher."); + Debug.LogWarning($"{name} has `AdjustHeight` enabled but there is no raycast hit below {pos}. Trying again 10 meters higher."); pos.y += 10; } } diff --git a/Scripts/Runtime/SoundController.cs b/Scripts/Runtime/SoundController.cs index 3c1d3bd..5e5f8aa 100644 --- a/Scripts/Runtime/SoundController.cs +++ b/Scripts/Runtime/SoundController.cs @@ -9,7 +9,7 @@ public class SoundController : MonoBehaviour AudioClip[] m_WingFlapClip; AudioSource audioSource; - + float timeOfLastSound; private void Awake() { audioSource = GetComponent(); @@ -19,9 +19,14 @@ public void PlaySound() { if (m_WingFlapClip.Length == 0) return; - audioSource.clip = m_WingFlapClip[Random.Range(0, m_WingFlapClip.Length)]; - audioSource.pitch = Random.Range(0.95f, 1.05f); - audioSource.Play(); + if (Time.timeSinceLevelLoad > timeOfLastSound) + { + audioSource.clip = m_WingFlapClip[Random.Range(0, m_WingFlapClip.Length)]; + audioSource.pitch = Random.Range(0.95f, 1.05f); + audioSource.Play(); + + timeOfLastSound = Time.timeSinceLevelLoad + (audioSource.clip.length * 1.1f); + } } } } From bdb3ee7a0f1f69d9ecf4f24d9c5d7a14d2a21c0d Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 00:31:42 -0800 Subject: [PATCH 27/36] A whole bunch of tuning on the dragon flight... getting much closer now. --- Prefabs/Large Creature Waypoint.prefab | 2 +- Prefabs/Waypoint.prefab | 2 +- Scripts/Runtime/MoveToWaypoint.cs | 8 +- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 139 ++++++++++-------- 4 files changed, 87 insertions(+), 64 deletions(-) diff --git a/Prefabs/Large Creature Waypoint.prefab b/Prefabs/Large Creature Waypoint.prefab index 1da848f..d769947 100644 --- a/Prefabs/Large Creature Waypoint.prefab +++ b/Prefabs/Large Creature Waypoint.prefab @@ -79,7 +79,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &4879797774331033280 Transform: m_ObjectHideFlags: 0 diff --git a/Prefabs/Waypoint.prefab b/Prefabs/Waypoint.prefab index bd42a1b..904f7a1 100644 --- a/Prefabs/Waypoint.prefab +++ b/Prefabs/Waypoint.prefab @@ -79,7 +79,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &4372954971884194727 Transform: m_ObjectHideFlags: 0 diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 135ef17..1aa3649 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -188,9 +188,11 @@ void Update() { OnWaypointArrival(); - Vector3 pos = -transform.forward * Random.Range(2.5f, 3.5f); - pos += transform.right * Random.Range(-0.5f, -0.5f); - pos += transform.up * Random.Range(0.5f, 1f); + Vector3 pos = -transform.forward * Random.Range(m_waypointPrefab.ClearRadius * 3, m_waypointPrefab.ClearRadius * 4); + pos += transform.right * Random.Range(-m_waypointPrefab.ClearRadius / 2, -m_waypointPrefab.ClearRadius); + pos += transform.up * Random.Range(-m_waypointPrefab.ClearRadius / 2, -m_waypointPrefab.ClearRadius); + pos.y += 10; // ensuring we are above the terrain + pos.y = m_SteeringRig.GetObstructionHeight(pos) + m_waypointPrefab.ClearRadius; GameObject go = Instantiate(m_waypointPrefab.gameObject, transform.position + pos, Quaternion.identity); go.name = stuckWaypointName; diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 4c1ac32..eb9bf7a 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -30,9 +30,9 @@ public class FlyingSteeringRig : AnimatorActorController float m_MaxForwardForce = 10; [SerializeField, Tooltip("The maximum forward velocity for this body.")] internal float maxSpeed = 8; - [SerializeField, Tooltip("The maximum distance that can be steered from the target direction. Setting this higher will allow the body to go more away from a direct line to the target.")] - [Range(1f, 5f)] - float m_MaxAvoidanceLength = 2f; + [SerializeField, Tooltip("The avoidance strength of the body. A higher setting will result in the body moving rapidly away from obstructions, while a lower setting will result in slower, smoother movements.")] + [Range(0.1f, 5f)] + float m_AvoidanceStrength = 2f; [SerializeField, Tooltip("The body will attempt to avoid colliders on these layers.")] LayerMask m_AvoidanceLayers; @@ -197,17 +197,7 @@ public float height { get { - //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame - - RaycastHit hit; - if (Physics.Raycast(rb.position, Vector3.down, out hit, Mathf.Infinity)) - { - return hit.distance; - } - else - { - return 0; - } + return GetObstructionHeight(rb.position); } } @@ -222,6 +212,8 @@ public float DestinationHeight { if (cachedDestination != destination) { + cachedDestination = destination; + RaycastHit hit; if (Physics.Raycast(destination.position, Vector3.down, out hit, Mathf.Infinity)) { @@ -235,6 +227,25 @@ public float DestinationHeight return cachedDestinationHeight; } } + + /// + /// Get the ground height below a given point, or the heighest point of any obstruction below that point. + /// + /// The heighest obstruction point below the supplied point or 0 if no obstruction is seen. + /// + public float GetObstructionHeight(Vector3 point) + { + //OPTIMIZE: cache the result of this for a few frames at a time since it is potentially called multiple times a frame + RaycastHit hit; + if (Physics.Raycast(point, Vector3.down, out hit, Mathf.Infinity)) + { + return hit.distance; + } + else + { + return 0; + } + } protected override void Awake() { base.Awake(); @@ -270,29 +281,35 @@ public override void MoveTo(Transform destination) private void ConfigureSensors() { + float forwardSensitivity = 0.8f; + float sidewaysSensitivity = 0.2f; + float upSensitivity = 1f; + float downSensitivity = 1f; + List sensors = new List(); - sensors.Add(new Sensor(transform.forward, 3, maxSpeed * 1.5f, 1, m_AvoidanceLayers)); // near forward - sensors.Add(new Sensor(transform.forward * 2 - transform.right, 1.5f, maxSpeed * 0.6f, 0.9f, m_AvoidanceLayers)); // forward/forward/left - sensors.Add(new Sensor(transform.forward - transform.right, 1f, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // forward/left - sensors.Add(new Sensor(transform.forward - transform.right * 2, 0, maxSpeed * 0.8f, 0.7f, m_AvoidanceLayers)); // forward/left/left - sensors.Add(new Sensor(transform.forward * 2 + transform.right, 1.5f, maxSpeed * 0.9f, m_AvoidanceLayers)); // forward/forward/right - sensors.Add(new Sensor(transform.forward + transform.right, 1f, maxSpeed * 0.8f, m_AvoidanceLayers)); // forward/right - sensors.Add(new Sensor(transform.forward + transform.right * 2, 0, maxSpeed * 0.7f, m_AvoidanceLayers)); // forward/right/right - - sensors.Add(new Sensor(-transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // left - sensors.Add(new Sensor(transform.right, 0, maxSpeed * 0.6f, m_AvoidanceLayers)); // right - - sensors.Add(new Sensor(transform.up, 0, maxSpeed * 0.5f, m_AvoidanceLayers)); // up - sensors.Add(new Sensor(transform.up + transform.forward, 0, maxSpeed * 1.5f, 1.0f, m_AvoidanceLayers)); // up/forward - sensors.Add(new Sensor(transform.up + transform.forward * 2, 0, maxSpeed * 1.5f, 1.0f, m_AvoidanceLayers)); // up/forward/forward - sensors.Add(new Sensor(transform.up - transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/left - sensors.Add(new Sensor(transform.up + transform.right, 0, maxSpeed * 0.7f, 0.8f, m_AvoidanceLayers)); // up/right - - sensors.Add(new Sensor(-transform.up, 0, m_OptimalHeight * 2, 0.1f, m_AvoidanceLayers)); // down - sensors.Add(new Sensor(-transform.up - transform.right, 0, m_MinHeight * 0.5f, 0.3f, m_AvoidanceLayers)); // down/left - sensors.Add(new Sensor(-transform.up + transform.forward, 0, m_MinHeight, 0.5f, m_AvoidanceLayers)); // down/forward - sensors.Add(new Sensor(-transform.up + transform.forward * 2, 0, m_MinHeight * 2, 0.2f, m_AvoidanceLayers)); // down/forward/forward - sensors.Add(new Sensor(-transform.up + transform.right, 0, m_MinHeight * 0.7f, 0.4f, m_AvoidanceLayers)); // down/right + sensors.Add(new Sensor(transform.forward, true, 3, maxSpeed * 1.5f, forwardSensitivity * 1f, m_AvoidanceLayers)); // near forward + sensors.Add(new Sensor(transform.forward * 2 - transform.right, true, 1.5f, maxSpeed * 0.6f, forwardSensitivity * sidewaysSensitivity * 0.6f, m_AvoidanceLayers)); // forward/forward/left + sensors.Add(new Sensor(transform.forward - transform.right, true, 1f, maxSpeed * 0.7f, forwardSensitivity * sidewaysSensitivity * 0.4f, m_AvoidanceLayers)); // forward/left + sensors.Add(new Sensor(transform.forward - transform.right * 2, true, 0, maxSpeed * 0.8f, forwardSensitivity * sidewaysSensitivity * 0.2f, m_AvoidanceLayers)); // forward/left/left + sensors.Add(new Sensor(transform.forward * 2 + transform.right, true, 1.5f, maxSpeed * 0.9f, forwardSensitivity * sidewaysSensitivity * 0.6f, m_AvoidanceLayers)); ; // forward/forward/right + sensors.Add(new Sensor(transform.forward + transform.right, true, 1f, maxSpeed * 0.8f, forwardSensitivity * sidewaysSensitivity * 0.4f, m_AvoidanceLayers)); // forward/right + sensors.Add(new Sensor(transform.forward + transform.right * 2, true, 0, maxSpeed * 0.7f, forwardSensitivity * sidewaysSensitivity * 0.2f, m_AvoidanceLayers)); // forward/right/right + + sensors.Add(new Sensor(-transform.right, true, 0, maxSpeed * 0.6f, sidewaysSensitivity * 0.3f, m_AvoidanceLayers)); // left + sensors.Add(new Sensor(transform.right, true, 0, maxSpeed * 0.6f, sidewaysSensitivity * 0.3f, m_AvoidanceLayers)); // right + + sensors.Add(new Sensor(transform.up, false, 0, maxSpeed * 0.5f, upSensitivity * 0.6f, m_AvoidanceLayers)); // up + sensors.Add(new Sensor(transform.up + transform.forward, false, 0, maxSpeed * 1.5f, upSensitivity * 0.6f, m_AvoidanceLayers)); // up/forward + sensors.Add(new Sensor(transform.up + transform.forward * 2, false, 0, maxSpeed * 1.5f, upSensitivity * 0.4f, m_AvoidanceLayers)); // up/forward/forward + sensors.Add(new Sensor(transform.up - transform.right, false, 0, maxSpeed * 0.7f, upSensitivity * sidewaysSensitivity * 0.6f, m_AvoidanceLayers)); // up/left + sensors.Add(new Sensor(transform.up + transform.right, false, 0, maxSpeed * 0.7f, upSensitivity * sidewaysSensitivity * 0.6f, m_AvoidanceLayers)); // up/right + + sensors.Add(new Sensor(-transform.up, false, 0, m_OptimalHeight * 2, downSensitivity * 0.1f, m_AvoidanceLayers)); // down + sensors.Add(new Sensor(-transform.up - transform.right, false, 0, m_MinHeight * 0.5f, downSensitivity * sidewaysSensitivity * 0.3f, m_AvoidanceLayers)); // down/left + sensors.Add(new Sensor(-transform.up + transform.forward, false, 0, m_MinHeight, downSensitivity * 0.4f, m_AvoidanceLayers)); // down/forward + sensors.Add(new Sensor(-transform.up + transform.forward * 2, false, 0, m_MinHeight * 2, downSensitivity * 0.3f, m_AvoidanceLayers)); // down/forward/forward + sensors.Add(new Sensor(-transform.up + transform.right, false, 0, m_MinHeight * 0.7f, downSensitivity * sidewaysSensitivity * 0.3f, m_AvoidanceLayers)); // down/right + sensorArray = sensors.ToArray(); } @@ -323,15 +340,15 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) if (GetInterimPointAdjustedForApproachHeight().y < rb.position.y && sensorArray[i].sensorDirection.y < 0) { - // skip downward sensors as they would result in a push back up as we are trying to go down. - // note that forward and up sensors can still result in a small upward force depending on + // skip downward sensors as they would result in an undesirable push back up when we are trying to go down. + // Forward and up sensors can still result in a small upward force depending on // the rotation of the body. This serves to force a levelling out as obstructions get nearer. continue; } strength += sensorArray[i].lastObstructionRatio; } - return strength * Mathf.Clamp(strength.magnitude, 0, m_MaxAvoidanceLength); + return strength * Mathf.Clamp(strength.magnitude, 0, m_AvoidanceStrength); } void Start() { @@ -481,8 +498,9 @@ private void FlightPhysics() // Keep the bottom facing down float z = rb.rotation.eulerAngles.z; if (z > 180f) z -= 360f; - float force = Mathf.Clamp(z / 45f, -1f, 1f) * m_MaxTorque; + float force = Mathf.Clamp(z / 90f, -1f, 1f) * m_MaxTorque; rb.AddTorque(rb.transform.forward * -force); + Debug.Log($"Torque force: {force}"); ApplyForces(moveDirection); } @@ -497,30 +515,26 @@ private Vector3 GetInterimPointAdjustedForApproachHeight() Vector3 desiredDirection = (destination.position - rb.position); if (desiredDirection.sqrMagnitude > approachDistanceSqr) { - if (DestinationHeight > m_OptimalHeight) - { - interimDestination.y = destination.position.y; - } - else + if (DestinationHeight < m_OptimalHeight) { - interimDestination.y = m_OptimalHeight; + interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_OptimalHeight; } } else if (m_AutoLand && desiredDirection.sqrMagnitude > prepareToLandDistanceSqr) { if (DestinationHeight < m_MinHeight) { - interimDestination.y = m_MinHeight; + interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_MinHeight; } } else if (m_AutoLand && desiredDirection.sqrMagnitude > landingDistanceSqr) { if (DestinationHeight < m_LandingHeight) { - interimDestination.y = destination.position.y; + interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_LandingHeight; } } - else if (m_AutoLand && destination.position.y < m_LandingHeight) + else if (m_AutoLand && DestinationHeight < m_LandingHeight) { interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y, destination.position.y, Time.fixedDeltaTime); isLanding = true; @@ -645,6 +659,11 @@ private void OnDrawGizmosSelected() { for (int i = 0; i < sensorArray.Length; i++) { + Gizmos.color = Color.white; + Vector3 interimPoint = GetInterimPointAdjustedForApproachHeight(); + Gizmos.DrawSphere(interimPoint, 0.5f); + Gizmos.DrawLine(rb.transform.position, interimPoint); + Vector3 direction = rb.transform.TransformDirection(sensorArray[i].sensorDirection); float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); @@ -697,6 +716,8 @@ class Sensor public float avoidanceSensitivity = 0.6f; + public bool rotateWithRigidbody = true; + private LayerMask avoidanceLayers; internal Vector3 lastObstructionRatio { @@ -713,17 +734,10 @@ internal Vector3 lastObstructionRatio } } } - - public Sensor(Vector3 direction, float radius, float maxLength, LayerMask avoidanceLayers) { - this.sensorDirection = direction; - this.radius = radius; - this.maxLength = maxLength; - this.avoidanceLayers = avoidanceLayers; - } - - public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceSensitivity, LayerMask avoidanceLayers) + public Sensor(Vector3 direction, bool rotateWithRigidbody, float radius, float maxLength, float avoidanceSensitivity, LayerMask avoidanceLayers) { this.sensorDirection = direction; + this.rotateWithRigidbody = rotateWithRigidbody; this.radius = radius; this.maxLength = maxLength; this.avoidanceSensitivity = avoidanceSensitivity; @@ -737,7 +751,14 @@ public Sensor(Vector3 direction, float radius, float maxLength, float avoidanceS /// public bool Pulse(FlyingSteeringRig rig) { - Vector3 direction = rig.rb.transform.TransformDirection(this.sensorDirection); + Vector3 direction; + if (rotateWithRigidbody) + { + direction = rig.rb.transform.TransformDirection(this.sensorDirection); + } else + { + direction = sensorDirection; + } float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rb.velocity.magnitude / rig.maxSpeed)); Ray ray = new Ray(rig.rb.transform.position, direction); From 799c649441de0f893d1aede050dfc969f8cab187 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 00:47:48 -0800 Subject: [PATCH 28/36] Smooth the repulson over time, now we are looking really good! --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index eb9bf7a..f694b27 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -203,6 +203,8 @@ public float height private Transform cachedDestination; private float cachedDestinationHeight; + private Vector3 oldRepulsion; + /// /// Returns the height of the current destination relative to the nearest obstacle below it. /// @@ -316,7 +318,7 @@ private void ConfigureSensors() /// /// Get a direction that will push the object away from detected obstacles. /// - /// If true then all sensors will be updated immediately. Use this if you need very accurate avoidance. Othersie leave as the default false. + /// If true then all sensors will be updated immediately. Use this if you need very accurate avoidance. Othersie leave as the default - false. /// Vector3 GetRepulsionDirection(bool updateAllSensors = false) { @@ -476,7 +478,8 @@ private void FlightPhysics() moveDirection += desiredDirection; } - Vector3 repulsion = GetRepulsionDirection(); + Vector3 repulsion = Vector3.Lerp(oldRepulsion, GetRepulsionDirection(), Time.deltaTime); + oldRepulsion = repulsion; if (repulsion.sqrMagnitude > 0.01f) { moveDirection += repulsion.normalized; @@ -498,9 +501,8 @@ private void FlightPhysics() // Keep the bottom facing down float z = rb.rotation.eulerAngles.z; if (z > 180f) z -= 360f; - float force = Mathf.Clamp(z / 90f, -1f, 1f) * m_MaxTorque; + float force = Mathf.Clamp(z / 20f, -1f, 1f) * m_MaxTorque; rb.AddTorque(rb.transform.forward * -force); - Debug.Log($"Torque force: {force}"); ApplyForces(moveDirection); } From e8500f4f0ae0de0c6504df876acf8453839c4c9d Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 12:07:35 -0800 Subject: [PATCH 29/36] Add speed controller to the animations --- Animations/DragonController.controller | 28 +++++++++++-------- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 4 +++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 293c965..062b467 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -656,72 +656,78 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: + - m_Name: Speed + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} - m_Name: isGrounded m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: isTakingOff m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: isLanding m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: roll m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: pitch m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: yaw m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: verticalVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: forwardVelocity m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: glide m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: turn m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: forward m_Type: 1 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index f694b27..62fca8b 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -643,6 +643,8 @@ void SetAnimationParameters() m_Animator.SetFloat(AnimationHash.verticalVelocity, verticalVelocity); m_Animator.SetFloat(AnimationHash.forwardVelocity, forwardVelocity); m_Animator.SetBool(AnimationHash.glide, glide); + + m_Animator.SetFloat(AnimationHash.speed, Mathf.Clamp((rb.velocity.magnitude / m_MaxSpeed) * 1.6f, 0.9f, 1.8f)); } private void OnDrawGizmosSelected() @@ -780,6 +782,8 @@ public bool Pulse(FlyingSteeringRig rig) internal static class AnimationHash { #region parameters + internal static int speed = Animator.StringToHash("speed"); + internal static int isGrounded = Animator.StringToHash("isGrounded"); internal static int isTakingOff= Animator.StringToHash("isTakingOff"); internal static int isLanding = Animator.StringToHash("isLanding"); From 688b3c0136af6841312c3b957dc24f025dba1916 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 12:20:13 -0800 Subject: [PATCH 30/36] More tilt when turning --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 62fca8b..7b6149d 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -501,7 +501,7 @@ private void FlightPhysics() // Keep the bottom facing down float z = rb.rotation.eulerAngles.z; if (z > 180f) z -= 360f; - float force = Mathf.Clamp(z / 20f, -1f, 1f) * m_MaxTorque; + float force = Mathf.Clamp(z / 120f, -1f, 1f) * m_MaxTorque; rb.AddTorque(rb.transform.forward * -force); ApplyForces(moveDirection); From cf1fc28985180bbd4365a212211613454eb53907 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 17:57:37 -0800 Subject: [PATCH 31/36] Fix the landing and simplify some of the flight/landing phsyics --- Animations/DragonController.controller | 22 +++---- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 66 +++++++++++++------ 2 files changed, 56 insertions(+), 32 deletions(-) diff --git a/Animations/DragonController.controller b/Animations/DragonController.controller index 062b467..19565bb 100644 --- a/Animations/DragonController.controller +++ b/Animations/DragonController.controller @@ -107,13 +107,13 @@ AnimatorState: m_IKOnFeet: 0 m_WriteDefaultValues: 1 m_Mirror: 0 - m_SpeedParameterActive: 0 + m_SpeedParameterActive: 1 m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 m_Motion: {fileID: -5995950608809702562} m_Tag: - m_SpeedParameter: + m_SpeedParameter: speed m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: @@ -229,13 +229,13 @@ AnimatorState: m_IKOnFeet: 0 m_WriteDefaultValues: 1 m_Mirror: 0 - m_SpeedParameterActive: 0 + m_SpeedParameterActive: 1 m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 m_Motion: {fileID: 2102132162150371118} m_Tag: - m_SpeedParameter: + m_SpeedParameter: speed m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: @@ -444,13 +444,13 @@ AnimatorState: m_IKOnFeet: 0 m_WriteDefaultValues: 1 m_Mirror: 0 - m_SpeedParameterActive: 0 + m_SpeedParameterActive: 1 m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 m_Motion: {fileID: 7400000, guid: a3bba46aa8991b143b164fe8f22f6d79, type: 2} m_Tag: - m_SpeedParameter: + m_SpeedParameter: speed m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: @@ -656,9 +656,9 @@ AnimatorController: m_Name: DragonController serializedVersion: 5 m_AnimatorParameters: - - m_Name: Speed + - m_Name: speed m_Type: 1 - m_DefaultFloat: 0 + m_DefaultFloat: 1 m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 0} @@ -1195,7 +1195,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 6ee1aad5e0fb6404e83daaa12fe3b60c, type: 2} m_Threshold: 30 - m_Position: {x: -0.65, y: 0.7} + m_Position: {x: -0.65, y: 0.6} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1203,7 +1203,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: 8672a58cf3dba174fabfc1a6e917128b, type: 2} m_Threshold: 34 - m_Position: {x: 0, y: 0.8} + m_Position: {x: 0, y: 0.7} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity @@ -1211,7 +1211,7 @@ BlendTree: - serializedVersion: 2 m_Motion: {fileID: 7400000, guid: f5f6ad99c462a594b9a74b5934303e29, type: 2} m_Threshold: 38 - m_Position: {x: 0.65, y: 0.7} + m_Position: {x: 0.65, y: 0.6} m_TimeScale: 1 m_CycleOffset: 0 m_DirectBlendParameter: angularVelocity diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 7b6149d..f69c89d 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -197,7 +197,7 @@ public float height { get { - return GetObstructionHeight(rb.position); + return GetObstructionHeight(rb.transform.position); } } @@ -254,13 +254,13 @@ protected override void Awake() ConfigureSensors(); - float landingDistance = m_ArrivalDistance * 5f; + float landingDistance = m_ArrivalDistance * 3f; landingDistanceSqr = landingDistance * landingDistance; float prepareToLandDistance = landingDistance * 4f; prepareToLandDistanceSqr = prepareToLandDistance * prepareToLandDistance; - float approachDistance = landingDistance * 6f; + float approachDistance = landingDistance * 20f; approachDistanceSqr = approachDistance * approachDistance; } @@ -339,10 +339,12 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) sensorArray[i].Pulse(this); } - if (GetInterimPointAdjustedForApproachHeight().y < rb.position.y - && sensorArray[i].sensorDirection.y < 0) + if (sensorArray[i].sensorDirection.y < 0 + && Vector3.SqrMagnitude(rb.transform.position - destination.position) < approachDistanceSqr + && destination.position.y < rb.transform.position.y) { - // skip downward sensors as they would result in an undesirable push back up when we are trying to go down. + // skip downward sensors when approaching a destination that is below the current position + // as they would result in an undesirable push back up when we are trying to go down. // Forward and up sensors can still result in a small upward force depending on // the rotation of the body. This serves to force a levelling out as obstructions get nearer. continue; @@ -350,7 +352,9 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) strength += sensorArray[i].lastObstructionRatio; } - return strength * Mathf.Clamp(strength.magnitude, 0, m_AvoidanceStrength); + Vector3 repulsion = strength * Mathf.Clamp(strength.magnitude, 0, m_AvoidanceStrength); + Debug.Log($"Repulsion direction is {repulsion}"); + return repulsion; } void Start() { @@ -428,6 +432,8 @@ private void LandingPhysics() { isLanding = false; isGrounded = true; + //m_Agent.enabled = true; + //m_Agent.Warp(rb.transform.position); m_TimeOfLastLanding = Time.timeSinceLevelLoad; return; } @@ -458,6 +464,8 @@ private void LandingPhysics() rb.AddTorque(rb.transform.right * -force); ApplyForces(moveDirection); + + rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed / 10); } private void FlightPhysics() @@ -486,7 +494,7 @@ private void FlightPhysics() } else { - moveDirection += repulsion * 100; + moveDirection += repulsion * 10; } // Rotate towards the desired direction @@ -495,7 +503,7 @@ private void FlightPhysics() Quaternion desiredRotation = Quaternion.FromToRotation(rb.transform.forward, moveDirection); desiredRotation.ToAngleAxis(out angle, out axis); angle = angle > 180f ? angle - 360f : angle; - var torque = Mathf.Clamp(angle / 20f, -1f, 1f) * m_MaxTorque; + var torque = Mathf.Clamp(angle, -1f, 1f) * m_MaxTorque; rb.AddTorque(axis * torque); // Keep the bottom facing down @@ -504,6 +512,8 @@ private void FlightPhysics() float force = Mathf.Clamp(z / 120f, -1f, 1f) * m_MaxTorque; rb.AddTorque(rb.transform.forward * -force); + //Debug.Log($"Move direction is {moveDirection}, normalized is {moveDirection.normalized}"); + ApplyForces(moveDirection); } @@ -514,31 +524,31 @@ private void FlightPhysics() private Vector3 GetInterimPointAdjustedForApproachHeight() { Vector3 interimDestination = destination.position; - Vector3 desiredDirection = (destination.position - rb.position); - if (desiredDirection.sqrMagnitude > approachDistanceSqr) + float desiredDirectionSqrMagnitude = (destination.position - rb.position).sqrMagnitude; + if (desiredDirectionSqrMagnitude > approachDistanceSqr) { if (DestinationHeight < m_OptimalHeight) { - interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_OptimalHeight; + interimDestination.y = GetObstructionHeight(destination.position) + m_OptimalHeight; } } - else if (m_AutoLand && desiredDirection.sqrMagnitude > prepareToLandDistanceSqr) + else if (m_AutoLand && desiredDirectionSqrMagnitude > prepareToLandDistanceSqr) { if (DestinationHeight < m_MinHeight) { - interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_MinHeight; + interimDestination.y = GetObstructionHeight(destination.position) + m_MinHeight; } } - else if (m_AutoLand && desiredDirection.sqrMagnitude > landingDistanceSqr) + else if (m_AutoLand && desiredDirectionSqrMagnitude > landingDistanceSqr) { if (DestinationHeight < m_LandingHeight) { - interimDestination.y = (interimDestination.y - GetObstructionHeight(interimDestination)) + m_LandingHeight; + interimDestination.y = GetObstructionHeight(destination.position) + m_LandingHeight; } } else if (m_AutoLand && DestinationHeight < m_LandingHeight) { - interimDestination.y = Mathf.Lerp(m_LandingHeight + destination.position.y, destination.position.y, Time.fixedDeltaTime); + interimDestination.y = Mathf.Lerp(transform.position.y, destination.position.y, desiredDirectionSqrMagnitude / m_LandingHeight); isLanding = true; } @@ -554,15 +564,16 @@ private void ApplyForces(Vector3 moveDirection) // Vertical force to add float verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(moveDirection.normalized.y)); - previousForwardForce = forwardForce; - previousVerticalForce = verticalForce; - // Add the forces + //Debug.Log($"Forward force is {forwardForce}, vertical force is {verticalForce}."); rb.AddForce((Mathf.Lerp(previousForwardForce, forwardForce, Time.deltaTime) * moveDirection.normalized) + (Mathf.Lerp(previousVerticalForce, verticalForce, Time.deltaTime) * rb.transform.up)); // Don't go over maximum speed rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed); + + previousForwardForce = forwardForce; + previousVerticalForce = verticalForce; } /// @@ -592,7 +603,9 @@ private void GroundMovement() { rb.freezeRotation = true; - if (m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad && Random.value <= 0.01) { + if (Vector3.SqrMagnitude(rb.transform.position - destination.position) > approachDistanceSqr + && m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad + && Random.value <= 0.01) { TakeOff(); return; } @@ -663,6 +676,17 @@ private void OnDrawGizmosSelected() { for (int i = 0; i < sensorArray.Length; i++) { + if (sensorArray[i].sensorDirection.y < 0 + && Vector3.SqrMagnitude(rb.transform.position - destination.position) < approachDistanceSqr + && destination.position.y < rb.transform.position.y) + { + // skip downward sensors when approaching a destination that is below the current position + // as they would result in an undesirable push back up when we are trying to go down. + // Forward and up sensors can still result in a small upward force depending on + // the rotation of the body. This serves to force a levelling out as obstructions get nearer. + continue; + } + Gizmos.color = Color.white; Vector3 interimPoint = GetInterimPointAdjustedForApproachHeight(); Gizmos.DrawSphere(interimPoint, 0.5f); From 1ceeafa96b43534c848b5523dc636c43d80a588a Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 5 Mar 2022 19:09:49 -0800 Subject: [PATCH 32/36] Handle landing on surfaces that are not at y == 0 --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index f69c89d..ae964c2 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -353,7 +353,7 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) } Vector3 repulsion = strength * Mathf.Clamp(strength.magnitude, 0, m_AvoidanceStrength); - Debug.Log($"Repulsion direction is {repulsion}"); + //Debug.Log($"Repulsion direction is {repulsion}"); return repulsion; } void Start() @@ -529,21 +529,43 @@ private Vector3 GetInterimPointAdjustedForApproachHeight() { if (DestinationHeight < m_OptimalHeight) { - interimDestination.y = GetObstructionHeight(destination.position) + m_OptimalHeight; + float obstructionHeight = GetObstructionHeight(destination.position); + if (obstructionHeight > 0) + { + interimDestination.y = obstructionHeight + m_OptimalHeight; + } + else + { + interimDestination.y += m_OptimalHeight; + } } } else if (m_AutoLand && desiredDirectionSqrMagnitude > prepareToLandDistanceSqr) { if (DestinationHeight < m_MinHeight) { - interimDestination.y = GetObstructionHeight(destination.position) + m_MinHeight; + float obstructionHeight = GetObstructionHeight(destination.position); + if (obstructionHeight > 0) + { + interimDestination.y = obstructionHeight + m_MinHeight; + } else + { + interimDestination.y += m_MinHeight; + } } } else if (m_AutoLand && desiredDirectionSqrMagnitude > landingDistanceSqr) { if (DestinationHeight < m_LandingHeight) { - interimDestination.y = GetObstructionHeight(destination.position) + m_LandingHeight; + float obstructionHeight = GetObstructionHeight(destination.position); + if (obstructionHeight > 0) { + interimDestination.y = obstructionHeight + m_LandingHeight; + } + else + { + interimDestination.y += m_LandingHeight; + } } } else if (m_AutoLand && DestinationHeight < m_LandingHeight) From 4571ca9791836591491b56ebd1fe4a4ef026e03a Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sun, 6 Mar 2022 16:53:27 -0800 Subject: [PATCH 33/36] More simplification of the interim flight destination. --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 39 ++----------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index ae964c2..b382316 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -215,16 +215,7 @@ public float DestinationHeight if (cachedDestination != destination) { cachedDestination = destination; - - RaycastHit hit; - if (Physics.Raycast(destination.position, Vector3.down, out hit, Mathf.Infinity)) - { - cachedDestinationHeight = hit.distance; - } - else - { - cachedDestinationHeight = 0; - } + cachedDestinationHeight = GetObstructionHeight(destination.position); } return cachedDestinationHeight; } @@ -529,43 +520,21 @@ private Vector3 GetInterimPointAdjustedForApproachHeight() { if (DestinationHeight < m_OptimalHeight) { - float obstructionHeight = GetObstructionHeight(destination.position); - if (obstructionHeight > 0) - { - interimDestination.y = obstructionHeight + m_OptimalHeight; - } - else - { - interimDestination.y += m_OptimalHeight; - } + interimDestination.y += m_OptimalHeight; } } else if (m_AutoLand && desiredDirectionSqrMagnitude > prepareToLandDistanceSqr) { if (DestinationHeight < m_MinHeight) { - float obstructionHeight = GetObstructionHeight(destination.position); - if (obstructionHeight > 0) - { - interimDestination.y = obstructionHeight + m_MinHeight; - } else - { - interimDestination.y += m_MinHeight; - } + interimDestination.y += m_MinHeight; } } else if (m_AutoLand && desiredDirectionSqrMagnitude > landingDistanceSqr) { if (DestinationHeight < m_LandingHeight) { - float obstructionHeight = GetObstructionHeight(destination.position); - if (obstructionHeight > 0) { - interimDestination.y = obstructionHeight + m_LandingHeight; - } - else - { - interimDestination.y += m_LandingHeight; - } + interimDestination.y += m_LandingHeight; } } else if (m_AutoLand && DestinationHeight < m_LandingHeight) From 554562896b628a72d958844a9c47cf5a4b93c965 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Wed, 6 Apr 2022 18:11:59 -0700 Subject: [PATCH 34/36] Minor Refactorings --- Scripts/Runtime/BoxAreaSpawner.cs | 4 ++-- Scripts/Runtime/MoveToWaypoint.cs | 4 ++-- Scripts/Runtime/WayPoint.cs | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Scripts/Runtime/BoxAreaSpawner.cs b/Scripts/Runtime/BoxAreaSpawner.cs index b1053ac..2758b49 100644 --- a/Scripts/Runtime/BoxAreaSpawner.cs +++ b/Scripts/Runtime/BoxAreaSpawner.cs @@ -112,7 +112,7 @@ void Spawn() if (nextSlot == -1) return; // No spawn slots available //OPTIMIZATION: Use a pool - WayPoint go = Instantiate(ToSpawn) as WayPoint; + WayPoint go = Instantiate(ToSpawn); go.name += instanceCount++; int nTrys = 0; @@ -239,7 +239,7 @@ public void OnDrawGizmosSelected() if (m_ShowAvailable || m_ShowUnavailable) { //OPTIMIZATION: Use a cached sample object (See start of method as well) - WayPoint go = Instantiate(ToSpawn) as WayPoint; + WayPoint go = Instantiate(ToSpawn); float depth = SizeX / 2; float xInterval = Mathf.Max(0.3f, SizeX / 20); diff --git a/Scripts/Runtime/MoveToWaypoint.cs b/Scripts/Runtime/MoveToWaypoint.cs index 1aa3649..202e772 100644 --- a/Scripts/Runtime/MoveToWaypoint.cs +++ b/Scripts/Runtime/MoveToWaypoint.cs @@ -12,8 +12,6 @@ public class MoveToWaypoint : MonoBehaviour enum SelectionStrategy { nearest, furthest, random }; [Header("Sensors")] - [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] - WayPoint m_waypointPrefab; [SerializeField, Tooltip("The range of the waypoint sensor this body has.")] float m_sensorRange = 200; [SerializeField, Tooltip("The layers on which waypoints will be detected by this body")] @@ -30,6 +28,8 @@ enum SelectionStrategy { nearest, furthest, random }; float m_StuckDuration = 0.5f; [SerializeField, Tooltip("The tolerance to use when deciding if the item is stuck. If the object moves more than this distance in any direction in the `stuckDuration` then it will be considered to be moving.")] float m_StuckTolerance = 0.05f; + [SerializeField, Tooltip("The waypoint prefab to use when getting the object to move out of a stuck state.")] + WayPoint m_waypointPrefab; [Header("Arrival Behaviours")] [SerializeField, Tooltip("If you have [Photo Session](https://github.com/TheWizardsCode/PhotoSession) and this setting is true then a new photo will be taken each time the target reaches a waypoint. " + diff --git a/Scripts/Runtime/WayPoint.cs b/Scripts/Runtime/WayPoint.cs index 05467cd..a52c843 100644 --- a/Scripts/Runtime/WayPoint.cs +++ b/Scripts/Runtime/WayPoint.cs @@ -11,6 +11,7 @@ namespace WizardsCode.AI /// or points of interest. /// /// + [RequireComponent(typeof(Collider))] public class WayPoint : MonoBehaviour { [SerializeField, Tooltip("The radiues that will be tested for obstructions. If an obstruction is found within this radius then a new spawn point will be generated.")] From e81ccd2bf10bcbfdb61baf16d1f3bb8666627ee4 Mon Sep 17 00:00:00 2001 From: Ross Gardler Date: Sat, 9 Apr 2022 14:49:57 -0700 Subject: [PATCH 35/36] Protect against a null reference --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index b382316..19de57e 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -185,8 +185,14 @@ public bool isFlying { get { - return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.flightState - || m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.glideState; + if (m_Animator) + { + return m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.flightState + || m_Animator.GetCurrentAnimatorStateInfo(0).shortNameHash == AnimationHash.glideState; + } else + { + return true; + } } } From 338ce33f601114d37e6e3abca6b5554a3eb5e11f Mon Sep 17 00:00:00 2001 From: Yolan Date: Tue, 26 Apr 2022 00:00:04 -0700 Subject: [PATCH 36/36] Adjust ray calculations --- Scripts/Runtime/Steering/FlyingSteeringRig.cs | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Scripts/Runtime/Steering/FlyingSteeringRig.cs b/Scripts/Runtime/Steering/FlyingSteeringRig.cs index 19de57e..573ea78 100644 --- a/Scripts/Runtime/Steering/FlyingSteeringRig.cs +++ b/Scripts/Runtime/Steering/FlyingSteeringRig.cs @@ -10,7 +10,7 @@ namespace WizardsCode.AI { /// /// This rig provides a 3D navigation for flying creatures and objects. It detects opstacles on the expected path an flies over - /// them or around them if it can. + /// them or around them if it can. /// public class FlyingSteeringRig : AnimatorActorController { @@ -98,8 +98,8 @@ public override bool isIdle } } } - - + + /// /// Returns true if the body is currently on the ground. /// @@ -183,7 +183,7 @@ public bool isLanding public bool isFlying { - get + get { if (m_Animator) { @@ -250,10 +250,10 @@ protected override void Awake() base.Awake(); ConfigureSensors(); - + float landingDistance = m_ArrivalDistance * 3f; landingDistanceSqr = landingDistance * landingDistance; - + float prepareToLandDistance = landingDistance * 4f; prepareToLandDistanceSqr = prepareToLandDistance * prepareToLandDistance; @@ -263,7 +263,7 @@ protected override void Awake() protected override void Update() { - if (isGrounded) base.Update(); + if (isGrounded) base.Update(); } public override void MoveTo(Transform destination) @@ -314,7 +314,7 @@ private void ConfigureSensors() /// /// Get a direction that will push the object away from detected obstacles. - /// + /// /// If true then all sensors will be updated immediately. Use this if you need very accurate avoidance. Othersie leave as the default - false. /// Vector3 GetRepulsionDirection(bool updateAllSensors = false) @@ -342,7 +342,7 @@ Vector3 GetRepulsionDirection(bool updateAllSensors = false) { // skip downward sensors when approaching a destination that is below the current position // as they would result in an undesirable push back up when we are trying to go down. - // Forward and up sensors can still result in a small upward force depending on + // Forward and up sensors can still result in a small upward force depending on // the rotation of the body. This serves to force a levelling out as obstructions get nearer. continue; } @@ -403,7 +403,7 @@ protected virtual void FixedUpdate() { GroundMovement(); } - } + } else if (isTakingOff) { // Take off is handled in the animation controller, so once we are flying we are good. @@ -413,7 +413,7 @@ protected virtual void FixedUpdate() else if (isLanding) { LandingPhysics(); - } else + } else { FlightPhysics(); } @@ -437,7 +437,7 @@ private void LandingPhysics() Vector3 desiredDirection; Vector3 interimDestination = GetInterimPointAdjustedForApproachHeight(); - + desiredDirection = (interimDestination - rb.position); Vector3 moveDirection = Vector3.zero; if (desiredDirection.sqrMagnitude > 1) @@ -555,8 +555,9 @@ private Vector3 GetInterimPointAdjustedForApproachHeight() private void ApplyForces(Vector3 moveDirection) { // Forward force to add - float forwardDotMove = Vector3.Dot(rb.transform.forward, moveDirection.normalized); - float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); + //float forwardDotMove = Vector3.Dot(rb.transform.forward, moveDirection.normalized); + //float forwardForce = Mathf.Lerp(m_MaxStrafeForce, m_MaxForwardForce, Mathf.Clamp01(forwardDotMove)); + var forwardForce = m_MaxForwardForce; // Vertical force to add float verticalForce = Mathf.Lerp(0, m_MaxVerticalForce, Mathf.Clamp01(moveDirection.normalized.y)); @@ -579,8 +580,8 @@ private void ApplyForces(Vector3 moveDirection) private void TakeOff() { Vector3 repulsion = GetRepulsionDirection(true); - if (repulsion.y < 0) { - return; + if (repulsion.y < 0) { + return; } rb.freezeRotation = false; @@ -600,8 +601,8 @@ private void GroundMovement() { rb.freezeRotation = true; - if (Vector3.SqrMagnitude(rb.transform.position - destination.position) > approachDistanceSqr - && m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad + if (Vector3.SqrMagnitude(rb.transform.position - destination.position) > approachDistanceSqr + && m_TimeOfLastLanding + m_MinTimeOnGround < Time.timeSinceLevelLoad && Random.value <= 0.01) { TakeOff(); return; @@ -679,7 +680,7 @@ private void OnDrawGizmosSelected() { // skip downward sensors when approaching a destination that is below the current position // as they would result in an undesirable push back up when we are trying to go down. - // Forward and up sensors can still result in a small upward force depending on + // Forward and up sensors can still result in a small upward force depending on // the rotation of the body. This serves to force a levelling out as obstructions get nearer. continue; } @@ -690,7 +691,7 @@ private void OnDrawGizmosSelected() Gizmos.DrawLine(rb.transform.position, interimPoint); Vector3 direction = rb.transform.TransformDirection(sensorArray[i].sensorDirection); - float length = Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); + float length = (rb.velocity.magnitude / maxSpeed) * sensorArray[i].maxLength; //Mathf.Lerp(0, sensorArray[i].maxLength, Mathf.Clamp01(rb.velocity.magnitude * maxSpeed)); Vector3 endPoint; if (sensorArray[i].hit.collider == null) @@ -706,7 +707,7 @@ private void OnDrawGizmosSelected() if (sensorArray[i].radius > 0) { - float currentRadius = Mathf.Lerp(0, sensorArray[i].radius, Mathf.Clamp01(rb.velocity.magnitude / maxSpeed)); + float currentRadius = Mathf.Lerp(0, sensorArray[i].radius, Mathf.Clamp01(rb.velocity.magnitude * maxSpeed)); Gizmos.DrawLine(rb.position, endPoint); Gizmos.DrawWireSphere(endPoint, currentRadius); } @@ -731,7 +732,7 @@ class Sensor /// The RaycastHit or null depending on whether the sensor hit anything on the last pulse /// public RaycastHit hit; - + /// /// Direction relative to `transform.forward`. /// @@ -784,12 +785,12 @@ public bool Pulse(FlyingSteeringRig rig) { direction = sensorDirection; } - float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rb.velocity.magnitude / rig.maxSpeed)); + float length = Mathf.Lerp(0, maxLength, Mathf.Clamp01(rig.rb.velocity.magnitude * rig.maxSpeed)); Ray ray = new Ray(rig.rb.transform.position, direction); if (radius > 0) { - float currentRadius = Mathf.Lerp(0, radius, Mathf.Clamp01(rig.rb.velocity.magnitude / rig.maxSpeed)); + float currentRadius = Mathf.Lerp(0, radius, Mathf.Clamp01(rig.rb.velocity.magnitude * rig.maxSpeed)); obstructionHit = Physics.SphereCast(ray, currentRadius, out hit, length, avoidanceLayers); } else