diff --git a/Assets/Prefabs/Player/DebugSMPlayerPrefab.prefab b/Assets/Prefabs/Player/DebugSMPlayerPrefab.prefab index 5993e86..0a44236 100644 --- a/Assets/Prefabs/Player/DebugSMPlayerPrefab.prefab +++ b/Assets/Prefabs/Player/DebugSMPlayerPrefab.prefab @@ -1025,7 +1025,7 @@ MonoBehaviour: playerGrav: 200 gravVel: 0 hasGlider: 0 - hasGrapple: 1 + hasGrapple: 0 hasWallrun: 0 hasNitro: 0 hasDash: 0 @@ -3659,8 +3659,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 630, y: -415} - m_SizeDelta: {x: 750, y: 300} + m_AnchoredPosition: {x: 618, y: -420} + m_SizeDelta: {x: 750, y: 310} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1710959632299265877 CanvasRenderer: @@ -3968,7 +3968,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 200, y: 50} + m_SizeDelta: {x: 160, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3381635986728581505 CanvasRenderer: @@ -4002,8 +4002,8 @@ MonoBehaviour: ' m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: c9c6ab728bbf8974783d3354922a042f, type: 2} + m_sharedMaterial: {fileID: -1126714427571281196, guid: c9c6ab728bbf8974783d3354922a042f, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -4027,8 +4027,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 30 - m_fontSizeBase: 30 + m_fontSize: 40 + m_fontSizeBase: 40 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 @@ -4063,7 +4063,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 66.04541, y: 0, z: 66.29382, w: 0} + m_margin: {x: -5.729248, y: 0, z: 0.47424316, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -4858,8 +4858,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 851, y: -494} - m_SizeDelta: {x: 160, y: 160} + m_AnchoredPosition: {x: 810, y: -480} + m_SizeDelta: {x: 230, y: 160} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6578614756615956982 CanvasRenderer: diff --git a/Assets/Scenes/Demos/MovementScene.unity b/Assets/Scenes/Demos/MovementScene.unity index 93e4721..9a22188 100644 --- a/Assets/Scenes/Demos/MovementScene.unity +++ b/Assets/Scenes/Demos/MovementScene.unity @@ -677,6 +677,54 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 285861120} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &294252280 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 294252282} + - component: {fileID: 294252281} + m_Layer: 0 + m_Name: UnitTesting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &294252281 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 294252280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aa0652b68ed99a840aa63c2124fcb6ad, type: 3} + m_Name: + m_EditorClassIdentifier: + aSM: {fileID: 4756939987922741702} + mSM: {fileID: 4756939987922741701} + nSM: {fileID: 4756939987922741700} + oSM: {fileID: 4756939987922741699} + dSM: {fileID: 4756939987922741698} +--- !u!4 &294252282 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 294252280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 960, y: 530, z: -2.5767212} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &306592003 GameObject: m_ObjectHideFlags: 0 @@ -1003,14 +1051,128 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 377042322} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 36.3, y: 14.7, z: 13.7} + m_LocalPosition: {x: 0, y: 5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1405946433} - {fileID: 1709217282} + - {fileID: 662909870} + - {fileID: 418985301} m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &418985300 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 418985301} + - component: {fileID: 418985305} + - component: {fileID: 418985304} + - component: {fileID: 418985303} + - component: {fileID: 418985302} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: HookPoint + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &418985301 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 418985300} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -25} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 377042323} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &418985302 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 418985300} + 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!135 &418985303 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 418985300} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &418985304 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 418985300} + 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 &418985305 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 418985300} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &478416584 GameObject: m_ObjectHideFlags: 0 @@ -1467,6 +1629,118 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 650550299} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &662909869 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 662909870} + - component: {fileID: 662909874} + - component: {fileID: 662909873} + - component: {fileID: 662909872} + - component: {fileID: 662909871} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: HookPoint + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &662909870 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662909869} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 25} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 377042323} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &662909871 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662909869} + 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!135 &662909872 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662909869} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &662909873 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662909869} + 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 &662909874 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662909869} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &724425600 GameObject: m_ObjectHideFlags: 0 @@ -1499,67 +1773,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &781507019 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_RootOrder - value: 12 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalPosition.x - value: 350 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalPosition.y - value: 825 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalPosition.z - value: 1130 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalRotation.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 180 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450956, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450996, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_Name - value: King - objectReference: {fileID: 0} - - target: {fileID: 3173415395305450996, guid: d23bf55f2a40d494487eb188930f895d, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: d23bf55f2a40d494487eb188930f895d, type: 3} --- !u!1 &827706392 GameObject: m_ObjectHideFlags: 0 @@ -2618,7 +2831,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1405946429} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -30, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 377042323} @@ -3104,8 +3317,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1709217277} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 74.3, y: 9.8, z: 0} - m_LocalScale: {x: 10, y: 10, z: 10} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 377042323} m_RootOrder: 1 @@ -3625,61 +3838,9 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 420218350421039198, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_SizeDelta.x - value: 160 - objectReference: {fileID: 0} - - target: {fileID: 420218350421039198, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1707207228499037468, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: hasDash - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1707207228499037468, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: hasNitro - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1707207228499037468, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: hasGlider - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1707207228499037468, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: hasGrapple - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1707207228499037468, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: hasWallrun - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_fontSize - value: 40 - objectReference: {fileID: 0} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_margin.x - value: -5.729248 - objectReference: {fileID: 0} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_margin.z - value: 0.47424316 - objectReference: {fileID: 0} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_fontAsset - value: - objectReference: {fileID: 11400000, guid: c9c6ab728bbf8974783d3354922a042f, type: 2} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_fontSizeBase - value: 40 - objectReference: {fileID: 0} - - target: {fileID: 5082014531075731820, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_sharedMaterial - value: - objectReference: {fileID: -1126714427571281196, guid: c9c6ab728bbf8974783d3354922a042f, type: 2} - target: {fileID: 5759777694531189237, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} propertyPath: m_RootOrder - value: 13 + value: 12 objectReference: {fileID: 0} - target: {fileID: 5759777694531189237, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} propertyPath: m_LocalPosition.x @@ -3725,33 +3886,60 @@ PrefabInstance: propertyPath: m_Name value: DebugSMPlayerPrefab objectReference: {fileID: 0} - - target: {fileID: 8370702511891240678, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_SizeDelta.x - value: 750 - objectReference: {fileID: 0} - - target: {fileID: 8370702511891240678, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_SizeDelta.y - value: 310 - objectReference: {fileID: 0} - - target: {fileID: 8370702511891240678, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_AnchoredPosition.x - value: 618 - objectReference: {fileID: 0} - - target: {fileID: 8370702511891240678, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_AnchoredPosition.y - value: -420 - objectReference: {fileID: 0} - - target: {fileID: 9000899855765473272, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_SizeDelta.x - value: 230 - objectReference: {fileID: 0} - - target: {fileID: 9000899855765473272, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_AnchoredPosition.x - value: 810 - objectReference: {fileID: 0} - - target: {fileID: 9000899855765473272, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} - propertyPath: m_AnchoredPosition.y - value: -480 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} +--- !u!114 &4756939987922741698 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1707207228499037413, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} + m_PrefabInstance: {fileID: 4756939987922741697} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1cd2fe42d6a34c43bc4a8b65dfaf533, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &4756939987922741699 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1707207228499037410, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} + m_PrefabInstance: {fileID: 4756939987922741697} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aae777136fbdb954083d81a3deeb7313, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &4756939987922741700 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1707207228499037411, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} + m_PrefabInstance: {fileID: 4756939987922741697} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 455a2b894b8cfef4bab705dde1a6784b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &4756939987922741701 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1707207228499037412, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} + m_PrefabInstance: {fileID: 4756939987922741697} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9e5dfab4fa1cb9547a860b23f54e51f8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &4756939987922741702 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1707207228499037414, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3} + m_PrefabInstance: {fileID: 4756939987922741697} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0ec82a74ea7992f44b37925faefa63b6, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/DebugGrapple/dAerialGrappleAirState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/DebugGrapple/dAerialGrappleAirState.cs index 317669c..bc2af56 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/DebugGrapple/dAerialGrappleAirState.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/DebugGrapple/dAerialGrappleAirState.cs @@ -5,65 +5,86 @@ using UnityEngine; public class dAerialGrappleAirState : dAerialBaseState { - Vector3 initialForceDirection; + float distanceBeneathHook = -10f; // Distance Beneath Hook + float distanceAfterHook = 8f; // Distance After Hook - float distanceBeneathHook; - float distanceAfterHook; - Vector3 desiredPosition; - Vector3 tempForceDir; - Vector3 updatedYHookPoint; + Vector3 initialForceDirection; // Initial Force Direction + Vector3 desiredPosition; // Desired Player Position + Vector3 tempForceDir; // Temporary Force Direction for calculating if the position has been reached + Vector3 updatedYHookPoint; // updated y position of the hook - bool pointReached; - bool handReached = false; + bool pointReached; // Whether the player has reached the desired position + bool handReached = false; // Whether the grapple hand has reached - float initialForcePower; + float initialForcePower; // How much force to apply initially public override void EnterState(dAerialStateManager aSM, dAerialBaseState previousState){ - - distanceBeneathHook = -10f; - distanceAfterHook = 8f; + //Reset these Variables pointReached = false; + handReached = false; initialForcePower = 120; - + aSM.currentForcePower = initialForcePower; + //refresh jump number aSM.curJumpNum = 0; aSM.release = false; + //Calculate the update y position for the hook updatedYHookPoint = new Vector3(aSM.hookPoint.transform.position.x, aSM.hookPoint.transform.position.y - distanceBeneathHook, aSM.hookPoint.transform.position.z); - aSM.currentForcePower = initialForcePower; - handReached = false; - + } public override void ExitState(dAerialStateManager aSM, dAerialBaseState nextState){ + + //Reset Hand Rotation aSM.stickyHandParent.transform.localEulerAngles = Vector3.zero; + + //Deactivate Visuals aSM.handController.enabled = false; aSM.stickyHandParent.SetActive(false); aSM.lr.enabled = false; + //if the next state is grounded or wallrun if(nextState == aSM.GroundedState || nextState == aSM.WallRunState){ + + //don't apply the release force aSM.release = false; } else{ + + //apply release force aSM.release = true; + + //give the player a slight upwards direction on releasing aSM.pStats.GravVel = 10; } } public override void UpdateState(dAerialStateManager aSM){ + + //if the player has reached the calculated point if(pointReached){ - //if grounded at when the point is reached then goto grounded state + //if grounded if(aSM.isGrounded){ + + //switch to grounded state aSM.SwitchState(aSM.GroundedState); } + + //if isn't grounded else if(!aSM.isGrounded){ + + //switch to falling state aSM.SwitchState(aSM.FallingState); } - //if wallrunning then wallrun + + //if wallrunning else if(aSM.isWallRunning){ + + //switch to wallrun state aSM.SwitchState(aSM.WallRunState); } } @@ -73,68 +94,102 @@ public class dAerialGrappleAirState : dAerialBaseState public override void FixedUpdateState(dAerialStateManager aSM){ - ////////ADD A LINE RENDERER WHEN WE GET THE HAND MODEL - //Draw Line between player and hookpoint for debug purposes - Debug.DrawRay(aSM.transform.position, initialForceDirection); //Visual of line - - //Apply default gravity + //If the grapple hand hasn't reached if(!handReached){ + + //Throw player hand ThrowStickyHand(aSM); + + //Apply Regular gravity aSM.GravityCalculation(aSM.pStats.PlayerGrav); } + + //If the grapple hand has reached and the player hasn't reached the correct point else if(!pointReached && handReached){ + + //Start Retrieving the grapple hand RetrieveStickyHand(aSM); + + //Move the player using the calculated direction and power aSM.moveController.Move(initialForceDirection * initialForcePower * Time.deltaTime); + + //Disable gravity while moving aSM.GravityCalculation(0); + + //Set Gravity to 0 aSM.pStats.GravVel = 0; + //Calculate A temporary force direction for checking if point is reached tempForceDir = desiredPosition - aSM.transform.position; tempForceDir = tempForceDir.normalized; tempForceDir = new Vector3(tempForceDir.x,0,tempForceDir.z).normalized; + //if the player has approximately reached the right position if((aSM.postForceDirection - tempForceDir).magnitude >= .1f && !pointReached){ + + //Player has reached the calculated position pointReached = true; } } + else{ - //currentForcePower; + + //normal gravity if grapple is finished aSM.GravityCalculation(aSM.pStats.PlayerGrav); } + //Offset parent rotation for the hand if(aSM.stickyHandParent.active){ aSM.stickyHandParent.transform.localRotation = Quaternion.Euler(0.0f, 0.0f, aSM.stickyHandParent.transform.parent.rotation.z * -1.0f); } } - + + //Throw Hand toward hookpoint & calculate desired position public void ThrowStickyHand(dAerialStateManager aSM){ + + //If the sticky hand isn't active if(!aSM.stickyHandParent.active){ + + //enable hand aSM.stickyHandParent.SetActive(true); + + //enable line renderer aSM.lr.enabled = true; + + //move hand position to hand aSM.stickyHandParent.transform.position = aSM.handPosition.position; + + //enable the character controller on the hand aSM.handController.enabled = true; } + //set positioning for the line renderer aSM.lr.SetPosition(0,aSM.stickyHandParent.transform.position); aSM.lr.SetPosition(1,aSM.handPosition.transform.position); + //Hand Throw Direction Vector3 throwDir = (aSM.hookPoint.transform.position - aSM.stickyHandParent.transform.position).normalized; + //move the hand aSM.stickyHandParent.GetComponent().Move(throwDir * 120 * Time.deltaTime); + + //if the hand approximately reaches the correct point if(Vector3.Distance(aSM.hookPoint.transform.position, aSM.stickyHandParent.transform.position) <= 3f){ + //Calculate the desired position using current position when hook reaches Vector3 updatedXHookPointDirection = (new Vector3(aSM.transform.position.x, 0, aSM.transform.position.z) - new Vector3(aSM.hookPoint.transform.position.x, 0, aSM.hookPoint.transform.position.z)).normalized; - desiredPosition = updatedYHookPoint + (updatedXHookPointDirection * -distanceAfterHook); - //rope length limit initialForceDirection = desiredPosition - aSM.transform.position; initialForceDirection = initialForceDirection.normalized; - aSM.postForceDirection = new Vector3(initialForceDirection.x, 0, initialForceDirection.z).normalized; + + //Hand has Reached handReached = true; } } + //Retrieve Grapple Hand public void RetrieveStickyHand(dAerialStateManager aSM){ aSM.lr.SetPosition(0,aSM.stickyHandParent.transform.position); aSM.lr.SetPosition(1,aSM.handPosition.transform.position); diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/dAerialStateManager.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/dAerialStateManager.cs index fd95810..1e7d584 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/dAerialStateManager.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugAerialState/dAerialStateManager.cs @@ -69,6 +69,7 @@ public class dAerialStateManager : NetworkBehaviour Vector3 raycastOffset; Vector3 lastPos; Ray groundRay; // ground ray + //Raycasts to ensure player slips down steep ledges Ray angleRayLeft; Ray angleRayRight; Ray angleRayForward; @@ -77,6 +78,7 @@ public class dAerialStateManager : NetworkBehaviour Ray angleRayRightL; Ray angleRayForwardB; Ray angleRayBackwardsF; + /// RaycastHit groundHit; // ground raycast //Wallrun @@ -586,33 +588,54 @@ public class dAerialStateManager : NetworkBehaviour return false; } - //Modify This So it Actually gets the nearest hook with a preference for the one they are looking at - //Finds the nearest hook to the player + //Finds the nearest hook to the player with visual Preference int FindHookPoint() { - float least = maxGrabDistance; - int index = -1; - bool inSightLine; - bool hookInSight = false; + float sightLineleastDistance = maxGrabDistance; // distance to check for sightline hookpoints + float nonSightLineLeastDistance = maxGrabDistance; // distance to check for non sightline hookpoints + int index = -1; // Default hook index + bool inSightLine; // Whether a hook is in currently in sight line + bool hookInSight = false; //Whether a hook was in sight + + //Iterate through hookpoints for(int i = 0; i 0 && screenPoint.x > 0 && screenPoint.x < 1 && screenPoint.y > 0 && screenPoint.y < 1; - if (distance <= least) + //if the distance is less than the current closest closest sight line hook + if (distance <= sightLineleastDistance) { + //if the hook is in view point if(inSightLine){ + + //Update current grapple target index = i; - least = distance; + + //update closest sight line hook distance + sightLineleastDistance = distance; + + //A hook exists in sight line hookInSight = true; } - else if(!hookInSight && !inSightLine){ + + //if no hookpoints are or has been in sight and the the distance is less than the current closest closest non sight line hook + else if((!hookInSight && !inSightLine) && distance <= nonSightLineLeastDistance){ + + //update current grapple target index = i; + + //Update the closest non sight line hook distance + nonSightLineLeastDistance = distance; } } } + + //return the index of the closest hook with priority of ones in sightline return index; } diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugDashState/DebugDash/dDashDashingState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugDashState/DebugDash/dDashDashingState.cs index 85ecd23..dc6912c 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugDashState/DebugDash/dDashDashingState.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugDashState/DebugDash/dDashDashingState.cs @@ -7,7 +7,7 @@ public class dDashDashingState : dDashBaseState Vector3 moveDirection; // direction vector const float maxDashTime = .8f; // max dash time - float dashDistance = 15; // distance to dash + float dashDistance = 18; // distance to dash float dashStoppingSpeed = 0.1f; // how quickly they stop float currentDashTime = maxDashTime; // current dash time float dashSpeed = 12; // dash speed diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/AerialState/AerialStateManager.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/AerialState/AerialStateManager.cs index 8d94304..d3c4e99 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/AerialState/AerialStateManager.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/AerialState/AerialStateManager.cs @@ -603,31 +603,54 @@ public class AerialStateManager : NetworkBehaviour return false; } + //Finds the nearest hook to the player with visual Preference int FindHookPoint() { - float least = maxGrabDistance; - int index = -1; - bool inSightLine; - bool hookInSight = false; + float sightLineleastDistance = maxGrabDistance; // distance to check for sightline hookpoints + float nonSightLineLeastDistance = maxGrabDistance; // distance to check for non sightline hookpoints + int index = -1; // Default hook index + bool inSightLine; // Whether a hook is in currently in sight line + bool hookInSight = false; //Whether a hook was in sight + + //Iterate through hookpoints for(int i = 0; i 0 && screenPoint.x > 0 && screenPoint.x < 1 && screenPoint.y > 0 && screenPoint.y < 1; - if (distance <= least) + //if the distance is less than the current closest closest sight line hook + if (distance <= sightLineleastDistance) { + //if the hook is in view point if(inSightLine){ + + //Update current grapple target index = i; - least = distance; + + //update closest sight line hook distance + sightLineleastDistance = distance; + + //A hook exists in sight line hookInSight = true; } - else if(!hookInSight && !inSightLine){ + + //if no hookpoints are or has been in sight and the the distance is less than the current closest closest non sight line hook + else if((!hookInSight && !inSightLine) && distance <= nonSightLineLeastDistance){ + + //update current grapple target index = i; + + //Update the closest non sight line hook distance + nonSightLineLeastDistance = distance; } } } + + //return the index of the closest hook with priority of ones in sightline return index; } diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/DashState/Dash/DashDashingState.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/DashState/Dash/DashDashingState.cs index 7f8d9e8..58ff006 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/DashState/Dash/DashDashingState.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/DashState/Dash/DashDashingState.cs @@ -7,7 +7,7 @@ public class DashDashingState : DashBaseState Vector3 moveDirection; // direction vector const float maxDashTime = .8f; // max dash time - float dashDistance = 15; // distance to dash + float dashDistance = 18; // distance to dash float dashStoppingSpeed = 0.1f; // how quickly they stop float currentDashTime = maxDashTime; // current dash time float dashSpeed = 12; // dash speed diff --git a/Assets/Scripts/PlayerScripts/PlayerInventory.cs b/Assets/Scripts/PlayerScripts/PlayerInventory.cs index c9a7f10..3fb6387 100644 --- a/Assets/Scripts/PlayerScripts/PlayerInventory.cs +++ b/Assets/Scripts/PlayerScripts/PlayerInventory.cs @@ -7,16 +7,18 @@ using UnityEngine; public class PlayerInventory : NetworkBehaviour { - //List of items + //Dictionary of items [SerializeField] private Dictionary playerItemDict = new Dictionary(); public Dictionary PlayerItemDict{ get{ return playerItemDict; } } + //List for the network [SerializeField] private List networkItemList = new List(); public List NetworkItemList{ get{ return networkItemList; } } + //Scripts public PlayerStats pStats; @@ -33,22 +35,30 @@ public class PlayerInventory : NetworkBehaviour //Add item to player Inventory public void UpdateItemNetwork(string itemName, int add){ + //if Removing items if(add == 0) networkItemList.Remove(itemName); + //if adding items else if(add == 1 )networkItemList.Add(itemName); + //if nothing is being updated else Debug.Log("Nothing updated"); } //Remove Item player inv public void RemoveItem(Item item){ + //if item removal was successful if(playerItemDict.Remove(item.name)){ + + //Modify player stats item.Unequip(pStats, this.gameObject); } } //Updates Inventory to Add item to player list public int UpdateInventory(Item item, bool ableToAdd){ + + //if player can add the item if(!playerItemDict.ContainsKey(item.name) && ableToAdd){ Debug.Log("Item Added"); AddItem(item); diff --git a/Assets/Scripts/PlayerScripts/SMUnitTest.cs b/Assets/Scripts/PlayerScripts/SMUnitTest.cs new file mode 100644 index 0000000..c77532c --- /dev/null +++ b/Assets/Scripts/PlayerScripts/SMUnitTest.cs @@ -0,0 +1,424 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SMUnitTest : MonoBehaviour +{ + + //Players State Managers + public dAerialStateManager aSM; + public dMoveStateManager mSM; + public dNitroStateManager nSM; + public dOffenseStateManager oSM; + public dDashStateManager dSM; + + //MoveState current and next state + dMoveBaseState curMoveState; + dMoveBaseState nextMoveState; + //Legal move state transisitions + List moveIdleTransitions = new List(); + List moveWalkTransitions = new List(); + List moveJogTransitions = new List(); + List moveRunTransitions = new List(); + List moveSlideTransitions = new List(); + List moveCrouchTransitions = new List(); + List moveCrouchWalkTransitions = new List(); + List moveRagdollTransitions = new List(); + List moveRecoverTransitions = new List(); + + //Aerial current and next state + dAerialBaseState curAerialState; + dAerialBaseState nextAerialState; + //Legal aerial state transisitions + List aerialGroundedTransitions = new List(); + List aerialFallTransitions = new List(); + List aerialJumpTransitions = new List(); + List aerialWallrunTransitions = new List(); + List aerialGlideTransitions = new List(); + List aerialGrappleTransitions = new List(); + + //Nitro current and next state + dNitroBaseState curNitroState; + dNitroBaseState nextNitroState; + //Legal nitro state transisitions + List nitroNoneTransitions = new List(); + List nitroNitroingTransitions = new List(); + List nitroIncapacitatedTransitions = new List(); + List nitroCooldownTransitions = new List(); + + + //Offense current and next state + dOffenseBaseState curOffenseState; + dOffenseBaseState nextOffenseState; + //Legal offense state transisitions + List offenseNoneTransitions = new List(); + List offenseKickTransitions = new List(); + List offenseAirKickTransitions = new List(); + List offenseIncapacitatedTransitions = new List(); + List offenseCooldownTransitions = new List(); + + //Dash current and next state + dDashBaseState curDashState; + dDashBaseState nextDashState; + //Legal dash state transisitions + List dashNoneTransitions = new List(); + List dashDashingTransitions = new List(); + List dashIncapacitatedTransitions = new List(); + List dashCooldownTransitions = new List(); + + // Start is called before the first frame update + void Awake() + { + + PopulateTransitionLists(); + + //Intitial States for each state manager + curMoveState = mSM.currentState; + curAerialState = aSM.currentState; + curNitroState = nSM.currentState; + curOffenseState = oSM.currentState; + curDashState = dSM.currentState; + } + + // Update is called once per frame + void Update() + { + if(!UpdateMoveStates()){ + Debug.LogAssertion("An Illegal Move State transition has occured " + curMoveState + " tried to transition into " + nextMoveState); + } + + if(!UpdateAerialStates()){ + Debug.LogAssertion("An Illegal Aerial State transition has occured " + curAerialState + " tried to transition into " + nextAerialState); + } + + if(!UpdateNitroStates()){ + Debug.LogAssertion("An Illegal Nitro State transition has occured " + curNitroState + " tried to transition into " + nextNitroState); + } + + if(!UpdateDashStates()){ + Debug.LogAssertion("An Illegal Dash State transition has occured " + curDashState + " tried to transition into " + nextDashState); + } + + if(!UpdateOffenseStates()){ + Debug.LogAssertion("An Illegal Offense State transition has occured " + curOffenseState + " tried to transition into " + nextOffenseState); + } + } + + //Populates All State Manager Transition Lists + private void PopulateTransitionLists(){ + + ////Populate MoveStateManager Lists + moveIdleTransitions.Add(mSM.CrouchState); + moveIdleTransitions.Add(mSM.WalkState); + moveIdleTransitions.Add(mSM.RagdollState); + + moveWalkTransitions.Add(mSM.SlideState); + moveWalkTransitions.Add(mSM.JogState); + moveWalkTransitions.Add(mSM.IdleState); + moveWalkTransitions.Add(mSM.RagdollState); + + moveJogTransitions.Add(mSM.WalkState); + moveJogTransitions.Add(mSM.SlideState); + moveJogTransitions.Add(mSM.RunState); + moveJogTransitions.Add(mSM.RagdollState); + + moveRunTransitions.Add(mSM.SlideState); + moveRunTransitions.Add(mSM.JogState); + moveRunTransitions.Add(mSM.RagdollState); + + moveSlideTransitions.Add(mSM.CrouchState); + moveSlideTransitions.Add(mSM.WalkState); + moveSlideTransitions.Add(mSM.JogState); + moveSlideTransitions.Add(mSM.RunState); + moveSlideTransitions.Add(mSM.RagdollState); + + moveCrouchTransitions.Add(mSM.CrouchWalkState); + moveCrouchTransitions.Add(mSM.WalkState); + moveCrouchTransitions.Add(mSM.RagdollState); + + moveCrouchWalkTransitions.Add(mSM.CrouchState); + moveCrouchWalkTransitions.Add(mSM.WalkState); + moveCrouchWalkTransitions.Add(mSM.RagdollState); + + moveRagdollTransitions.Add(mSM.RecoveringState); + + moveRecoverTransitions.Add(mSM.IdleState); + //// + + ////Populate AerialStateManager Lists + aerialGroundedTransitions.Add(aSM.FallingState); + aerialGroundedTransitions.Add(aSM.JumpingState); + aerialGroundedTransitions.Add(aSM.WallRunState); + aerialGroundedTransitions.Add(aSM.GrappleAirState); + + aerialFallTransitions.Add(aSM.GroundedState); + aerialFallTransitions.Add(aSM.GlidingState); + aerialFallTransitions.Add(aSM.JumpingState); + aerialFallTransitions.Add(aSM.WallRunState); + aerialFallTransitions.Add(aSM.GrappleAirState); + + aerialJumpTransitions.Add(aSM.GroundedState); + aerialJumpTransitions.Add(aSM.FallingState); + aerialJumpTransitions.Add(aSM.WallRunState); + aerialJumpTransitions.Add(aSM.GrappleAirState); + + aerialWallrunTransitions.Add(aSM.GroundedState); + aerialWallrunTransitions.Add(aSM.FallingState); + aerialWallrunTransitions.Add(aSM.JumpingState); + aerialWallrunTransitions.Add(aSM.GrappleAirState); + + aerialGlideTransitions.Add(aSM.GroundedState); + aerialGlideTransitions.Add(aSM.FallingState); + aerialGlideTransitions.Add(aSM.WallRunState); + aerialGlideTransitions.Add(aSM.GrappleAirState); + + aerialGrappleTransitions.Add(aSM.GroundedState); + aerialGrappleTransitions.Add(aSM.FallingState); + aerialGrappleTransitions.Add(aSM.WallRunState); + //// + + ////Populate NitroStateManager Lists + nitroNoneTransitions.Add(nSM.NitroingState); + nitroNoneTransitions.Add(nSM.IncapacitatedState); + + nitroNitroingTransitions.Add(nSM.CooldownState); + nitroNitroingTransitions.Add(nSM.IncapacitatedState); + + nitroIncapacitatedTransitions.Add(nSM.NoneState); + + nitroCooldownTransitions.Add(nSM.NoneState); + nitroCooldownTransitions.Add(nSM.IncapacitatedState); + //// + + ////Populate DashStateManager Lists + dashNoneTransitions.Add(dSM.DashingState); + dashNoneTransitions.Add(dSM.IncapacitatedState); + + dashDashingTransitions.Add(dSM.CooldownState); + dashDashingTransitions.Add(dSM.IncapacitatedState); + + dashIncapacitatedTransitions.Add(dSM.NoneState); + + dashCooldownTransitions.Add(dSM.NoneState); + dashCooldownTransitions.Add(dSM.IncapacitatedState); + //// + + ////Populate OffenseStateManager Lists + offenseNoneTransitions.Add(oSM.KickState); + offenseNoneTransitions.Add(oSM.AirKickState); + offenseNoneTransitions.Add(oSM.IncapacitatedState); + + offenseKickTransitions.Add(oSM.CooldownState); + offenseKickTransitions.Add(oSM.IncapacitatedState); + + offenseAirKickTransitions.Add(oSM.CooldownState); + offenseAirKickTransitions.Add(oSM.IncapacitatedState); + + offenseIncapacitatedTransitions.Add(oSM.NoneState); + + offenseCooldownTransitions.Add(oSM.NoneState); + offenseCooldownTransitions.Add(oSM.IncapacitatedState); + //// + } + + //Move State Testing + private bool UpdateMoveStates(){ + if(curMoveState != mSM.currentState){ + if(ValidateMoveState(mSM.currentState)){ + curMoveState = mSM.currentState; + return true; + } + else{ + curMoveState = mSM.currentState; + nextMoveState = mSM.currentState; + return false; + } + } + return true; + } + + private bool ValidateMoveState(dMoveBaseState nextState){ + //Checks if The next state exists within the current transitions list + if(curMoveState == mSM.IdleState && moveIdleTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.WalkState && moveWalkTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.JogState && moveJogTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.RunState && moveRunTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.SlideState && moveSlideTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.CrouchState && moveCrouchTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.CrouchWalkState && moveCrouchWalkTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.RagdollState && moveRagdollTransitions.Contains(nextState)){ + return true; + } + else if(curMoveState == mSM.RecoveringState && moveRecoverTransitions.Contains(nextState)){ + return true; + } + else{ + return false; + } + } + + //Aerial State Testing + private bool UpdateAerialStates(){ + if(curAerialState != aSM.currentState){ + if(ValidateAerialState(aSM.currentState)){ + curAerialState = aSM.currentState; + return true; + } + else{ + curAerialState = aSM.currentState; + nextAerialState = aSM.currentState; + return false; + } + } + return true; + } + + private bool ValidateAerialState(dAerialBaseState nextState){ + //Checks if The next state exists within the current transitions list + if(curAerialState == aSM.GroundedState && aerialGroundedTransitions.Contains(nextState)){ + return true; + } + else if(curAerialState == aSM.FallingState && aerialFallTransitions.Contains(nextState)){ + return true; + } + else if(curAerialState == aSM.JumpingState && aerialJumpTransitions.Contains(nextState)){ + return true; + } + else if(curAerialState == aSM.WallRunState && aerialWallrunTransitions.Contains(nextState)){ + return true; + } + else if(curAerialState == aSM.GlidingState && aerialGlideTransitions.Contains(nextState)){ + return true; + } + else if(curAerialState == aSM.GrappleAirState && aerialGrappleTransitions.Contains(nextState)){ + return true; + } + else{ + return false; + } + } + + //Nitro State Testing + private bool UpdateNitroStates(){ + if(curNitroState != nSM.currentState){ + if(ValidateNitroState(nSM.currentState)){ + curNitroState = nSM.currentState; + return true; + } + else{ + curNitroState = nSM.currentState; + nextNitroState = nSM.currentState; + return false; + } + } + return true; + } + + private bool ValidateNitroState(dNitroBaseState nextState){ + //Checks if The next state exists within the current transitions list + if(curNitroState == nSM.NoneState && nitroNoneTransitions.Contains(nextState)){ + return true; + } + else if(curNitroState == nSM.NitroingState && nitroNitroingTransitions.Contains(nextState)){ + return true; + } + else if(curNitroState == nSM.IncapacitatedState && nitroIncapacitatedTransitions.Contains(nextState)){ + return true; + } + else if(curNitroState == nSM.CooldownState && nitroCooldownTransitions.Contains(nextState)){ + return true; + } + else{ + return false; + } + } + + //Dash State Testing + private bool UpdateDashStates(){ + if(curDashState != dSM.currentState){ + if(ValidateDashState(dSM.currentState)){ + curDashState = dSM.currentState; + return true; + } + else{ + curDashState = dSM.currentState; + nextDashState = dSM.currentState; + return false; + } + } + return true; + } + + private bool ValidateDashState(dDashBaseState nextState){ + //Checks if The next state exists within the current transitions list + if(curDashState == dSM.NoneState && dashNoneTransitions.Contains(nextState)){ + return true; + } + else if(curDashState == dSM.DashingState && dashDashingTransitions.Contains(nextState)){ + return true; + } + else if(curDashState == dSM.IncapacitatedState && dashIncapacitatedTransitions.Contains(nextState)){ + return true; + } + else if(curDashState == dSM.CooldownState && dashCooldownTransitions.Contains(nextState)){ + return true; + } + else{ + return false; + } + } + + //Offense State Testing + private bool UpdateOffenseStates(){ + if(curOffenseState != oSM.currentState){ + if(ValidateOffenseState(oSM.currentState)){ + curOffenseState = oSM.currentState; + return true; + } + else{ + curOffenseState = oSM.currentState; + nextOffenseState = oSM.currentState; + return false; + } + } + + return true; + } + + private bool ValidateOffenseState(dOffenseBaseState nextState){ + //Checks if The next state exists within the current transitions list + if(curOffenseState == oSM.NoneState && offenseNoneTransitions.Contains(nextState)){ + return true; + } + else if(curOffenseState == oSM.KickState && offenseKickTransitions.Contains(nextState)){ + return true; + } + else if(curOffenseState == oSM.AirKickState && offenseAirKickTransitions.Contains(nextState)){ + return true; + } + else if(curOffenseState == oSM.IncapacitatedState && offenseIncapacitatedTransitions.Contains(nextState)){ + return true; + } + else if(curOffenseState == oSM.CooldownState && offenseCooldownTransitions.Contains(nextState)){ + return true; + } + else{ + return false; + } + } + +} diff --git a/Assets/Scripts/PlayerScripts/SMUnitTest.cs.meta b/Assets/Scripts/PlayerScripts/SMUnitTest.cs.meta new file mode 100644 index 0000000..06f70db --- /dev/null +++ b/Assets/Scripts/PlayerScripts/SMUnitTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa0652b68ed99a840aa63c2124fcb6ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 2153e28..01becdc 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -9,32 +9,32 @@ EditorUserSettings: value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a flags: 0 RecentlyUsedScenePath-1: - value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a - flags: 0 - RecentlyUsedScenePath-2: value: 22424703114646680e0b0227036c7000021e17243f66333e243d04 flags: 0 - RecentlyUsedScenePath-3: + RecentlyUsedScenePath-2: value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9 flags: 0 - RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 - flags: 0 - RecentlyUsedScenePath-5: + RecentlyUsedScenePath-3: value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb flags: 0 - RecentlyUsedScenePath-6: + RecentlyUsedScenePath-4: value: 22424703114646680e0b0227036c7c1f18030a25203b68252320092a flags: 0 - RecentlyUsedScenePath-7: + RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c731f1415016439262f2434 flags: 0 - RecentlyUsedScenePath-8: + RecentlyUsedScenePath-6: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 - RecentlyUsedScenePath-9: + RecentlyUsedScenePath-7: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 + RecentlyUsedScenePath-8: + value: 22424703114646680e0b0227036c7b151b180b651f3c272428041c30eae93a3dd6e225fda92f31352d1b + flags: 0 + RecentlyUsedScenePath-9: + value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 + flags: 0 vcSharedLogLevel: value: 0d5e400f0650 flags: 0