diff --git a/Assets/Prefabs/Player/PlayerPrefab.prefab b/Assets/Prefabs/Player/PlayerPrefab.prefab index 862d09e..b601afb 100644 --- a/Assets/Prefabs/Player/PlayerPrefab.prefab +++ b/Assets/Prefabs/Player/PlayerPrefab.prefab @@ -11,6 +11,21 @@ GameObject: - component: {fileID: 394725941300514827} - component: {fileID: 3891196372269872751} - component: {fileID: 1779614325098168083} + - component: {fileID: 5086810605069144388} + - component: {fileID: 3725107173017604129} + - component: {fileID: 508183713705064073} + - component: {fileID: 6646742430777996202} + - component: {fileID: 6946259593417347243} + - component: {fileID: 273103334658887749} + - component: {fileID: 1952443820573609623} + - component: {fileID: 4323471435859684389} + - component: {fileID: 3672942772524564832} + - component: {fileID: 2620970719070296463} + - component: {fileID: 2356773567935625033} + - component: {fileID: 2942875262947626129} + - component: {fileID: 8956701063868523892} + - component: {fileID: 3772338269032432186} + - component: {fileID: 5687943635225929219} m_Layer: 0 m_Name: PlayerModel m_TagString: Untagged @@ -81,65 +96,25 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &7188906082087890184 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7188906082087890177} - - component: {fileID: 7188906082087890180} - - component: {fileID: 7188906082087890183} - - component: {fileID: 7188906082087890185} - - component: {fileID: 6558661690282462800} - - component: {fileID: 2274833863450849408} - - component: {fileID: 471272923182148881} - - component: {fileID: 1292213096936070766} - - component: {fileID: 7623511089535041046} - m_Layer: 3 - m_Name: PlayerPrefab - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &7188906082087890177 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1, y: 1.8, z: -0.2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 7188906082643956518} - - {fileID: 394725941300514827} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &7188906082087890180 +--- !u!114 &5086810605069144388 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} + m_GameObject: {fileID: 4814433541978696327} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &7188906082087890183 +--- !u!114 &3725107173017604129 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} + m_GameObject: {fileID: 4814433541978696327} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5a5d879591af1084ab5d3a35fcd53086, type: 3} @@ -147,13 +122,13 @@ MonoBehaviour: m_EditorClassIdentifier: items: [] pStats: {fileID: 0} ---- !u!114 &7188906082087890185 +--- !u!114 &508183713705064073 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} + m_GameObject: {fileID: 4814433541978696327} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 22ae0d31c49624d4fb9990f2f5f72fd9, type: 3} @@ -166,61 +141,13 @@ MonoBehaviour: minAngle: -30 maxAngle: 45 sensitivity: 301 ---- !u!143 &6558661690282462800 -CharacterController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 2 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &2274833863450849408 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - 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!54 &471272923182148881 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - 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!114 &1292213096936070766 +--- !u!114 &6646742430777996202 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} + m_GameObject: {fileID: 4814433541978696327} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} @@ -231,14 +158,14 @@ MonoBehaviour: PrefabHashGenerator: PlayerPrefab AlwaysReplicateAsRoot: 0 DontDestroyWithOwner: 0 ---- !u!114 &7623511089535041046 +--- !u!114 &6946259593417347243 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_Enabled: 1 + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} m_Name: @@ -279,6 +206,185 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!114 &273103334658887749 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5162a84172831f4449df60b9ad0ce22f, type: 3} + m_Name: + m_EditorClassIdentifier: + controller: {fileID: 0} +--- !u!114 &1952443820573609623 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3} + m_Name: + m_EditorClassIdentifier: + wallMaxDistance: 1 + wallSpeedMultiplier: 1.2 + minimumHeight: 1.2 + maxAngleRoll: 20 + normalizedAngleThreshold: 0.1 + jumpDuration: 1 + wallBouncing: 3 + cameraTransitionDuration: 1 + wallGravityDownForce: 20 +--- !u!114 &4323471435859684389 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 980b3f40ede2d8a4c96587100cf71d02, type: 3} + m_Name: + m_EditorClassIdentifier: + moveDirection: {x: 0, y: 0, z: 0} + dashDistance: 10 + dashStoppingSpeed: 0.1 +--- !u!114 &3672942772524564832 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cee70ea30de57ec43a325c1ca6257526, type: 3} + m_Name: + m_EditorClassIdentifier: + maxGrappleDistance: 25 +--- !u!114 &2620970719070296463 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f9b52b0ade3c44e47a3a4dc48c47ec1c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &2356773567935625033 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0c0aad94b3b1332408ef8e7d07f3b321, type: 3} + m_Name: + m_EditorClassIdentifier: + leg: {fileID: 0} +--- !u!114 &2942875262947626129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a8c22589436d2449a89cf3a40b6d252, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!54 &8956701063868523892 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &3772338269032432186 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!143 &5687943635225929219 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4814433541978696327} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 2 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &7188906082087890184 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7188906082087890177} + m_Layer: 3 + m_Name: PlayerPrefab + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7188906082087890177 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7188906082087890184} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1, y: 1.8, z: -0.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7188906082643956518} + - {fileID: 394725941300514827} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7188906082643956521 GameObject: m_ObjectHideFlags: 0 @@ -290,6 +396,7 @@ GameObject: - component: {fileID: 7188906082643956518} - component: {fileID: 7188906082643956516} - component: {fileID: 7188906082643956519} + - component: {fileID: 4875054560273456582} m_Layer: 3 m_Name: PlayerCam m_TagString: PlayerCam @@ -362,3 +469,16 @@ AudioListener: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7188906082643956521} m_Enabled: 1 +--- !u!114 &4875054560273456582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7188906082643956521} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 394466212a506df4da8f22e46bd4e333, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 4814433541978696327} diff --git a/Assets/Scenes/Demos/InventorySelection.unity b/Assets/Scenes/Demos/InventorySelection.unity index 1b6d5ae..a75d3b0 100644 --- a/Assets/Scenes/Demos/InventorySelection.unity +++ b/Assets/Scenes/Demos/InventorySelection.unity @@ -501,6 +501,46 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 623466146960117777, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1006370620272136424, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1121632309457683679, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1122837021074491360, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1602186932439279558, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3454731726544993114, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3772338269032432186, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Height + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4910425103423673310, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7061360697648900808, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_UseGravity + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7061360697648900808, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_IsKinematic + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} propertyPath: m_RootOrder value: 3 @@ -549,6 +589,22 @@ PrefabInstance: propertyPath: m_Name value: PlayerPrefab objectReference: {fileID: 0} + - target: {fileID: 7442108947324986527, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7623511089535041046, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8956701063868523892, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_UseGravity + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8956701063868523892, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_CollisionDetection + value: 3 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} --- !u!1 &591528209 diff --git a/Assets/Scenes/Demos/MovementScene.unity b/Assets/Scenes/Demos/MovementScene.unity index 561cfa5..beeee65 100644 --- a/Assets/Scenes/Demos/MovementScene.unity +++ b/Assets/Scenes/Demos/MovementScene.unity @@ -313,79 +313,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 228851343} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1001 &279177648 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2274833863450849408, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.y - value: 1.8 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.z - value: -0.2 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890183, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: items.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890183, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: items.Array.data[0] - value: - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890184, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Name - value: PlayerPrefab - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890184, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} --- !u!1 &478416584 GameObject: m_ObjectHideFlags: 0 @@ -1060,7 +987,7 @@ GameObject: - component: {fileID: 1493944131} m_Layer: 0 m_Name: Platforms - m_TagString: Untagged + m_TagString: Floor m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/Scripts/PlayerScripts/ItemScripts/InventoryManager.cs b/Assets/Scripts/PlayerScripts/ItemScripts/InventoryManager.cs index 5e153e9..061f336 100644 --- a/Assets/Scripts/PlayerScripts/ItemScripts/InventoryManager.cs +++ b/Assets/Scripts/PlayerScripts/ItemScripts/InventoryManager.cs @@ -4,15 +4,17 @@ using UnityEngine; public class InventoryManager : MonoBehaviour { - public Item[] allItems; - private List itemList; - public List ItemList{ + public Item[] allItems; + private List itemList; + public List ItemList{ get{ return itemList; } set{ itemList = value; } - } - void Awake(){ - allItems = Resources.LoadAll("ItemObjects"); + } + + + void Awake(){ + allItems = Resources.LoadAll("ItemObjects"); - itemList = new List(allItems); - } + itemList = new List(allItems); + } } diff --git a/Assets/Scripts/PlayerScripts/ItemScripts/SpecialItem.cs b/Assets/Scripts/PlayerScripts/ItemScripts/SpecialItem.cs index 539298c..94cc09f 100644 --- a/Assets/Scripts/PlayerScripts/ItemScripts/SpecialItem.cs +++ b/Assets/Scripts/PlayerScripts/ItemScripts/SpecialItem.cs @@ -13,8 +13,7 @@ public class SpecialItem : Item public bool hasNitroM; public bool hasDashM; public float cooldownM; - //public MonoScript scriptM; - + public override void Equip(PlayerStats p, GameObject player){ if(maxVelM != 0){ p.MaxVel += maxVelM; @@ -61,9 +60,6 @@ public class SpecialItem : Item if(hasDashM != false){ p.HasDash = hasDashM; } - /*if(scriptM != null){ - player.AddComponent(scriptM.GetClass()); - }*/ } public override void Unequip(PlayerStats p, GameObject player){ @@ -112,9 +108,7 @@ public class SpecialItem : Item if(hasDashM != false){ p.HasDash = false; } - /*if(scriptM != null){ - Destroy(player.GetComponent(scriptM.GetClass())); - }*/ + } } diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs index 8cf40c4..a4f3a9b 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using UnityEngine; //Mote: This should be refactored at some point public class Slide : MonoBehaviour{ - //this may be deprecated at some poiint later in development if we start ussing a rigid bod + public Camera playerCam; private bool isSliding = false; private CharacterController charController; @@ -11,10 +11,7 @@ public class Slide : MonoBehaviour{ private float orignalTraction; private RaycastHit ray; private Vector3 up; - // Start is called before the first frame update - void Start(){ - - } + private void Awake(){ charController = this.gameObject.GetComponentInParent(); playerStats = this.gameObject.GetComponentInParent(); diff --git a/Assets/Scripts/PlayerScripts/Player.cs b/Assets/Scripts/PlayerScripts/Player.cs deleted file mode 100644 index 06a0ed3..0000000 --- a/Assets/Scripts/PlayerScripts/Player.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Player : MonoBehaviour -{ -} diff --git a/Assets/Scripts/PlayerScripts/PlayerCam.cs b/Assets/Scripts/PlayerScripts/PlayerCam.cs new file mode 100644 index 0000000..1196014 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/PlayerCam.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerCam : MonoBehaviour +{ + public GameObject player; + + private Vector3 offset; + private Vector3 rad; + + void Start () + { + rad = (transform.position - player.transform.position); + } + + void Update () + { + offset = transform.parent.forward * rad.magnitude; + transform.position = new Vector3((player.transform.position.x - offset.x),((player.transform.position.y - offset.y)+2),(player.transform.position.z - offset.z)); + + } +} diff --git a/Assets/Scripts/PlayerScripts/Player.cs.meta b/Assets/Scripts/PlayerScripts/PlayerCam.cs.meta similarity index 83% rename from Assets/Scripts/PlayerScripts/Player.cs.meta rename to Assets/Scripts/PlayerScripts/PlayerCam.cs.meta index e75b2ac..089bcca 100644 --- a/Assets/Scripts/PlayerScripts/Player.cs.meta +++ b/Assets/Scripts/PlayerScripts/PlayerCam.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c2c2e0314365de34c923bb88c9b334ca +guid: 394466212a506df4da8f22e46bd4e333 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/PlayerScripts/PlayerInventory.cs b/Assets/Scripts/PlayerScripts/PlayerInventory.cs index 8589700..52c6752 100644 --- a/Assets/Scripts/PlayerScripts/PlayerInventory.cs +++ b/Assets/Scripts/PlayerScripts/PlayerInventory.cs @@ -13,7 +13,7 @@ public class PlayerInventory : MonoBehaviour void Awake(){ pStats = GetComponent(); - DontDestroyOnLoad(this.gameObject); + DontDestroyOnLoad(transform.parent.gameObject); } @@ -30,7 +30,6 @@ public class PlayerInventory : MonoBehaviour Debug.Log("Item Removed"); RemoveItem(item); } - } public void AddSpecialItem(T itemCandidate) { // Unless we don't want the four special items to be handled by inventory/inventory manager? diff --git a/Assets/Scripts/PlayerScripts/PlayerMovement.cs b/Assets/Scripts/PlayerScripts/PlayerMovement.cs index c164477..7c071bd 100644 --- a/Assets/Scripts/PlayerScripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/PlayerMovement.cs @@ -19,6 +19,9 @@ public class PlayerMovement : NetworkBehaviour private Vector3 moveX; private Vector3 driftVel; + //Player prefab + private GameObject parentObj; + //Character Moving private CharacterController moveController; @@ -63,9 +66,20 @@ public class PlayerMovement : NetworkBehaviour private CapsuleCollider capCol; private bool firstHit = false; private bool heldDown = false; + private bool beginRagTimer = false; + private float ragTime; private Vector3 prevRot; private Vector3 hitForce; + //Slide Variables + private bool isSliding = false; + private float originalTraction; + private RaycastHit ray; + private Vector3 up; + private bool qDown; + + //Kick Variables + void Awake() { //Initialize Components @@ -73,13 +87,16 @@ public class PlayerMovement : NetworkBehaviour rB = GetComponent(); capCol = GetComponent(); pStats = GetComponent(); + parentObj = transform.parent.gameObject; //camera transform - cam = GetComponentInChildren(); + cam = parentObj.GetComponentInChildren(); capCol.enabled = false; //Wallrun - //wallRun = gameObject.GetComponent(); + wallRun = gameObject.GetComponent(); + + up = this.gameObject.GetComponentInParent().up; } void Start() @@ -103,6 +120,7 @@ public class PlayerMovement : NetworkBehaviour // Otherwise we let the server handle moving us if (!IsLocalPlayer) { return; } + //Controls for camera Rotation(); @@ -119,7 +137,7 @@ public class PlayerMovement : NetworkBehaviour } else{ - if (rB.velocity.magnitude < 0.2f){ + if (RagdollTimer() == 0){ firstHit = false; DisableRagdoll(); @@ -147,8 +165,6 @@ public class PlayerMovement : NetworkBehaviour //Checks if player should respawn Respawn(); - - } @@ -172,9 +188,13 @@ public class PlayerMovement : NetworkBehaviour Gravity(); driftVel = Vector3.Lerp(driftVel, vel, pStats.Traction * Time.deltaTime); + + //Moving outside basic wasd //Jump Function Jump(); - + //Slide Function + Slide(); + moveController.Move(driftVel); } @@ -184,7 +204,7 @@ public class PlayerMovement : NetworkBehaviour public float PlayerSpeed() { //If nothing is pressed speed is 0 - if (Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f) + if ((Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f) || isSliding) { pStats.CurVel = 0.0f; return pStats.CurVel; @@ -225,7 +245,7 @@ public class PlayerMovement : NetworkBehaviour private void Jump() { //If space is pressed apply an upwards force to the player - if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum) + if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding) { AddImpact(transform.up, pStats.JumpPow); curJumpNum++; @@ -270,12 +290,22 @@ public class PlayerMovement : NetworkBehaviour //Camera and Player Rotation private void Rotation() { - transform.Rotate(Vector3.up * sensitivity * Time.deltaTime * Input.GetAxis("Mouse X")); + Vector3 lastCamPos = new Vector3(0,0,0); + Vector3 rotOffset = transform.localEulerAngles; + if(moveController.enabled){ + transform.parent.Rotate(Vector3.up * sensitivity * Time.deltaTime * Input.GetAxis("Mouse X")); + camRotation.x -= Input.GetAxis("Mouse Y") * sensitivity * Time.deltaTime; camRotation.x = Mathf.Clamp(camRotation.x, minAngle, maxAngle); cam.transform.localEulerAngles = camRotation; + } + /* + else{ + cam.transform.localEulerAngles = cam.transform.localEulerAngles - rotOffset; + } + */ } @@ -356,20 +386,91 @@ public class PlayerMovement : NetworkBehaviour } } private void EnableRagdoll(){ - prevRot = transform.localEulerAngles; - capCol.enabled = true; - moveController.enabled = false; - rB.isKinematic = false; - rB.detectCollisions = true; + ragTime = pStats.RecovTime; + prevRot = transform.localEulerAngles; + capCol.enabled = true; + moveController.enabled = false; + rB.isKinematic = false; + rB.detectCollisions = true; } private void DisableRagdoll(){ - capCol.enabled = false; - moveController.enabled = true; - rB.isKinematic = true; - rB.detectCollisions = false; - transform.localEulerAngles = prevRot; + capCol.enabled = false; + moveController.enabled = true; + rB.isKinematic = true; + rB.detectCollisions = false; + transform.localEulerAngles = prevRot; } + //When to begin the ragdoll timer + private float RagdollTimer(){ + if(beginRagTimer == false){ + beginRagTimer = Physics.Raycast(transform.position, -Vector3.up, distToGround + 1f); + } + + else if(ragTime <= 0){ + ragTime = 0; + beginRagTimer = false; + } + + if(beginRagTimer == true){ + ragTime -= Time.deltaTime; + } + + return ragTime; + } + + //Slide Function + private void Slide(){ + if (Input.GetKey(KeyCode.Q)){ + qDown = true; + if (isSliding == false){ + originalTraction = pStats.Traction; + this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); + isSliding = true; + moveController.height = 1.0f; + pStats.Traction = 0.01f; + + } + pStats.Traction += .02f; + } + else{ + qDown = false; + } + //NOTE: potentialy change this to only allow player back up if there is nothing above them + if (qDown == false && isSliding == true) { + //if nothing is above the object, stop slidding + if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) + { + this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x + 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); + isSliding = false; + moveController.height = 2.0f; + pStats.Traction = originalTraction; + + } + else{ + Debug.Log("Object above you"); + + } + } + //if button is not held down, and still slidding (if they let go but something was above them) check to see if something is still above them, if not + else if (Input.GetKey(KeyCode.Q) == false && isSliding==true){ + //if nothing is above the object, stop slidding + if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) + { + this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); + isSliding = false; + moveController.height = 2.0f; + pStats.Traction = originalTraction; + + } + else + { + Debug.Log("Object above you"); + + } + + } + } } diff --git a/Assets/Scripts/PlayerScripts/PlayerStats.cs b/Assets/Scripts/PlayerScripts/PlayerStats.cs index b0da84e..9db11a3 100644 --- a/Assets/Scripts/PlayerScripts/PlayerStats.cs +++ b/Assets/Scripts/PlayerScripts/PlayerStats.cs @@ -26,7 +26,7 @@ public class PlayerStats : MonoBehaviour set{ curVel = value; } } - //Player Jump power + //Player Acceleration private float acc = 0.1f; public float Acc{ get{ return acc; } @@ -62,7 +62,7 @@ public class PlayerStats : MonoBehaviour } //Player Recovery Time When Knocked Down - private float recovTime; + private float recovTime = 3.0f; public float RecovTime{ get{ return recovTime; } set{ recovTime = value; } @@ -112,7 +112,7 @@ public class PlayerStats : MonoBehaviour } //If The Player Has Dash - private bool hasDash = false; + private bool hasDash; public bool HasDash{ get{ return hasDash; } set{ hasDash = value; } @@ -124,12 +124,21 @@ public class PlayerStats : MonoBehaviour set{ playerPoints = value; } } - // void Update(){ - // VariableValidation(); - // } + void Update(){ + VariableValidation(); + } - // void VariableValidation(){ - // Debug.Assert((playerPoints != null && playerPoints > 0), "Not valid value"); - // } + void VariableValidation(){ + Debug.Assert((maxVel >= 0), "maxVel cannot be below zero"); + Debug.Assert((minVel >= 0), "minVel cannot be below zero"); + Debug.Assert((curVel >= 0), "curVel cannot be below zero"); + Debug.Assert((jumpPow >= 0), "jumpPow cannot be below zero"); + Debug.Assert((jumpNum >= 2), "jumpNum cannot be below zero"); + Debug.Assert((traction >= 0), "traction cannot be below zero"); + //Debug.Assert((kickPow >= 0), "Playerpoints cannot be below zero"); + Debug.Assert((recovTime >= 0), "recovTime cannot be below zero"); + Debug.Assert((playerGrav >= 0), "playerGrav cannot be below zero"); + Debug.Assert((playerPoints >= 0), "Playerpoints cannot be below zero"); + } } diff --git a/Assets/Scripts/PlayerScripts/Setup.cs b/Assets/Scripts/PlayerScripts/Setup.cs deleted file mode 100644 index aa28d53..0000000 --- a/Assets/Scripts/PlayerScripts/Setup.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Setup : MonoBehaviour -{ - private PlayerStats pstats; - public bool hasWallRun; - [Range( 1, 50)] - public float maxSpeed; - // Start is called before the first frame update - void Start() - { - pstats = this.gameObject.GetComponent(); - pstats.HasWallrun = hasWallRun; - pstats.MaxVel = maxSpeed; - } -} diff --git a/Assets/Scripts/PlayerScripts/Setup.cs.meta b/Assets/Scripts/PlayerScripts/Setup.cs.meta deleted file mode 100644 index 84b5c93..0000000 --- a/Assets/Scripts/PlayerScripts/Setup.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ed382e04d00059e40a6803fa4ad43469 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/SetInvScene/InvSceneSettings.cs b/Assets/Scripts/SetInvScene/InvSceneSettings.cs index 123f5db..7dc6646 100644 --- a/Assets/Scripts/SetInvScene/InvSceneSettings.cs +++ b/Assets/Scripts/SetInvScene/InvSceneSettings.cs @@ -6,6 +6,7 @@ using UnityEngine.SceneManagement; public class InvSceneSettings : MonoBehaviour { + GameObject pPar; GameObject player1; PlayerInventory pInv; public GameObject itemOptPrefab; @@ -18,22 +19,28 @@ public class InvSceneSettings : MonoBehaviour // Start is called before the first frame update void Awake(){ - player1 = GameObject.Find("PlayerPrefab"); + pPar = GameObject.Find("PlayerPrefab"); + player1 = pPar.transform.Find("PlayerModel").gameObject; pStats = player1.GetComponent(); pointText = GameObject.Find("PlayerPoints").GetComponentInChildren(); pInv = player1.GetComponent(); player1.GetComponent().enabled = false; - player1.transform.Find("PlayerCam").gameObject.SetActive(false); + pPar.transform.Find("PlayerCam").gameObject.SetActive(false); invMan = GetComponent(); } void Start(){ + player1.GetComponent().enabled = true; InitializeItemB(); pointsLeft = pStats.PlayerPoints; pointText.text = "Points Left: " + pointsLeft; } + void FixedUpdate(){ + itemToEnable(); + } + private void InitializeItemB(){ int index = 0; if(itemOptPrefab != null){ @@ -82,9 +89,27 @@ public class InvSceneSettings : MonoBehaviour } } + + //Enables Script on player + //NEEDS TO BE CLEANED UP AND IMPROVED + public void itemToEnable(){ + if(pStats.HasBlink != player1.GetComponent().enabled) + player1.GetComponent().enabled = pStats.HasBlink; + if(pStats.HasDash != player1.GetComponent().enabled) + player1.GetComponent().enabled = pStats.HasDash; + if(pStats.HasWallrun != player1.GetComponent().enabled) + player1.GetComponent().enabled = pStats.HasWallrun; + if(pStats.HasGrapple != player1.GetComponent().enabled) + player1.GetComponent().enabled = pStats.HasGrapple; + if(pStats.HasNitro != player1.GetComponent().enabled) + player1.GetComponent().enabled = pStats.HasNitro; + + } + public void nextScene(){ player1.GetComponent().enabled = true; - player1.transform.GetChild(0).gameObject.SetActive(true); + player1.GetComponent().enabled = false; + pPar.transform.GetChild(0).gameObject.SetActive(true); SceneManager.LoadScene (SceneManager.GetActiveScene().buildIndex + 1); } diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index ab274e7..d6fbece 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -8,6 +8,7 @@ TagManager: - kickable - PlayerCam - HookPoint + - Floor layers: - Default - TransparentFX @@ -15,7 +16,7 @@ TagManager: - Player - Water - UI - - + - Floor - - - diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index a06a718..f2e4115 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -21,7 +21,7 @@ EditorUserSettings: value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9 flags: 0 RecentlyUsedScenePath-5: - value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25 + value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 flags: 0 RecentlyUsedScenePath-6: value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930