From c7e2ba805b4859484594ba5d31d0a8308f7d1895 Mon Sep 17 00:00:00 2001 From: craftwill Date: Sat, 29 Oct 2022 14:45:29 -0400 Subject: [PATCH] Working ragdoll; Added sounds bytes utils --- Assets/FollowParent.cs | 13 + Assets/FollowParent.cs.meta | 11 + Assets/Prefabs/Player.prefab | 1122 +++++++++++++++++++- Assets/Scenes/LevelDesign.unity | 94 -- Assets/Scripts/PlayerController.cs | 5 + Assets/Scripts/Ragdoll.cs | 24 +- Assets/Scripts/Sound.meta | 8 + Assets/Scripts/Sound/SoundPlayer.cs | 37 + Assets/Scripts/Sound/SoundPlayer.cs.meta | 11 + Assets/Scripts/Sound/SoundTemplate.cs | 29 + Assets/Scripts/Sound/SoundTemplate.cs.meta | 11 + Assets/SoundPlayerHurt.asset | 19 + Assets/SoundPlayerHurt.asset.meta | 8 + ProjectSettings/DynamicsManager.asset | 2 +- ProjectSettings/TagManager.asset | 4 +- 15 files changed, 1281 insertions(+), 117 deletions(-) create mode 100644 Assets/FollowParent.cs create mode 100644 Assets/FollowParent.cs.meta create mode 100644 Assets/Scripts/Sound.meta create mode 100644 Assets/Scripts/Sound/SoundPlayer.cs create mode 100644 Assets/Scripts/Sound/SoundPlayer.cs.meta create mode 100644 Assets/Scripts/Sound/SoundTemplate.cs create mode 100644 Assets/Scripts/Sound/SoundTemplate.cs.meta create mode 100644 Assets/SoundPlayerHurt.asset create mode 100644 Assets/SoundPlayerHurt.asset.meta diff --git a/Assets/FollowParent.cs b/Assets/FollowParent.cs new file mode 100644 index 0000000..8dfc3ea --- /dev/null +++ b/Assets/FollowParent.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class FollowParent : MonoBehaviour +{ + [SerializeField] private Transform follow; + [SerializeField] private Rigidbody rg; + private void Update() + { + transform.position = follow.position; + } +} diff --git a/Assets/FollowParent.cs.meta b/Assets/FollowParent.cs.meta new file mode 100644 index 0000000..50645db --- /dev/null +++ b/Assets/FollowParent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fbc699a0e80590478455ba80b87897b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index b057b38..1ab7c67 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -17,7 +17,9 @@ GameObject: - component: {fileID: 1772573266731274163} - component: {fileID: 8474203461765366282} - component: {fileID: 1447597341752185403} - m_Layer: 0 + - component: {fileID: 1211811550} + - component: {fileID: 1211811541} + m_Layer: 8 m_Name: Player m_TagString: Player m_Icon: {fileID: 0} @@ -33,11 +35,12 @@ Transform: m_GameObject: {fileID: 1772573266731274171} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 4.54, y: 5.06, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 1.15, y: 1.15, z: 1.15} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1772573266864950257} - {fileID: 1772573266917019329} + - {fileID: 8017009972647805438} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -56,7 +59,7 @@ MeshRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1772573266731274171} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 @@ -274,8 +277,8 @@ MonoBehaviour: rb: {fileID: 1772573266731274174} canWalk: 1 canJump: 1 - movementSpeed: 0.3 - maxMovementSpeed: 20 + movementSpeed: 0.8 + maxMovementSpeed: 30 jumpPower: 3 afterJumpHorizontalSlowdownTime: 1 groundDrag: 1 @@ -310,6 +313,40 @@ CapsuleCollider: m_Height: 1.2361116 m_Direction: 1 m_Center: {x: 0, y: 0.07965708, z: 0.02819419} +--- !u!95 &1211811550 +Animator: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1772573266731274171} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1211811541 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1772573266731274171} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 54b4af10a3fe94f46bb698f348872322, type: 3} + m_Name: + m_EditorClassIdentifier: + _startsRagdolled: 1 + _hipBone: {fileID: 2527212996625801578} --- !u!1 &1772573266864950258 GameObject: m_ObjectHideFlags: 0 @@ -467,7 +504,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1772573266917019330} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -0.5, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_ConstrainProportionsScale: 1 m_Children: [] @@ -524,3 +561,1076 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1001 &1772573268368440628 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1772573266731274175} + m_Modifications: + - target: {fileID: 415409520219427762, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 724680186672344738, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 839605329347273950, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 971139183836952358, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 1387300314020487061, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 1663716157182040133, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 1733295938752975712, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 2235016154044298754, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 2700798974854016938, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 3715133904866702953, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 4504945525736367612, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 4791983728978394038, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 5088083818199436906, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 5167482598157626969, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 5634194097882010349, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 6196475737379223072, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 6325593496791849260, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 6370599175778234085, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 6488672914939713825, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 6617172571449626892, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 7116986881007807692, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 7343263733104670618, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 8102390840971711960, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 8236748231002806631, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.79 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalRotation.y + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8975820612264765040, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Name + value: Thief + objectReference: {fileID: 0} + - target: {fileID: 9175217856303482155, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7d85378c67373104c9c2627e9074c63d, type: 3} +--- !u!1 &1121331407115642225 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1663716157182040133, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &148593110 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1121331407115642225} + serializedVersion: 2 + m_Mass: 1.25 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!135 &148593111 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1121331407115642225} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.14693807 + m_Center: {x: 0, y: 0.14693807, z: 0} +--- !u!144 &148593109 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1121331407115642225} + m_ConnectedBody: {fileID: 1814985531} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.0000023307803, y: 0.49200407, z: 0.017678268} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -40 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 25 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 25 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &1339791428639413142 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 724680186672344738, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &820129353 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1339791428639413142} + serializedVersion: 2 + m_Mass: 1.25 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &820129355 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1339791428639413142} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.080246866 + m_Height: 0.32098746 + m_Direction: 1 + m_Center: {x: 0, y: 0.16049373, z: 0} +--- !u!144 &820129354 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1339791428639413142} + m_ConnectedBody: {fileID: 1814985531} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 0, z: -1} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.29387435, y: 0.36626366, z: 0.0010784462} + serializedVersion: 2 + m_SwingAxis: {x: 1, y: 0, z: 0} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -70 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 10 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 50 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &1386987085045488106 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 839605329347273950, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1279323246 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386987085045488106} + serializedVersion: 2 + m_Mass: 1.25 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1279323247 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386987085045488106} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.06411226 + m_Height: 0.3205613 + m_Direction: 1 + m_Center: {x: 0, y: 0.16028064, z: 0} +--- !u!144 &1279323245 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386987085045488106} + m_ConnectedBody: {fileID: 808057160} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: -1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.00000006030314, y: 0.32095513, z: 0.0000008493662} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: -1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -90 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!4 &2527212996625801578 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4290530948460944478, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!1 &3105160907196648285 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3715133904866702953, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1546596158 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3105160907196648285} + serializedVersion: 2 + m_Mass: 1.875 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1546596159 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3105160907196648285} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.08785888 + m_Height: 0.3514355 + m_Direction: 1 + m_Center: {x: 0, y: 0.17571776, z: 0} +--- !u!144 &1546596157 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3105160907196648285} + m_ConnectedBody: {fileID: 1148887309} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: -1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.0000014277175, y: 0.36003107, z: -0.0000000055879354} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -80 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &4459227346596893342 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2700798974854016938, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1148887309 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4459227346596893342} + serializedVersion: 2 + m_Mass: 1.875 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1148887311 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4459227346596893342} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.10800932 + m_Height: 0.36003107 + m_Direction: 1 + m_Center: {x: 0, y: 0.18001553, z: 0} +--- !u!144 &1148887310 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4459227346596893342} + m_ConnectedBody: {fileID: 1766216186} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: -1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.12661788, y: -0.06273905, z: -0.007898022} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -20 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 70 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 30 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &4797763370949944341 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6488672914939713825, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &517026816 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4797763370949944341} + serializedVersion: 2 + m_Mass: 1.875 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &517026817 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4797763370949944341} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.08762945 + m_Height: 0.3505178 + m_Direction: 1 + m_Center: {x: 0, y: 0.1752589, z: 0} +--- !u!144 &517026815 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4797763370949944341} + m_ConnectedBody: {fileID: 1271797531} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: -1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.0000028312206, y: 0.36004478, z: 0.0000000081490725} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -80 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &4849702360060177464 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6617172571449626892, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1271797531 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4849702360060177464} + serializedVersion: 2 + m_Mass: 1.875 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1271797533 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4849702360060177464} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.108013436 + m_Height: 0.36004478 + m_Direction: 1 + m_Center: {x: 0, y: 0.18002239, z: 0} +--- !u!144 &1271797532 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4849702360060177464} + m_ConnectedBody: {fileID: 1766216186} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: -1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.12661701, y: -0.06273852, z: -0.007813931} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -20 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 70 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 30 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &6775085890269410142 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5088083818199436906, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1655043588 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6775085890269410142} + serializedVersion: 2 + m_Mass: 1.25 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &1655043589 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6775085890269410142} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.064113565 + m_Height: 0.32056782 + m_Direction: 1 + m_Center: {x: 0, y: 0.16028391, z: 0} +--- !u!144 &1655043587 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6775085890269410142} + m_ConnectedBody: {fileID: 820129353} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.000000062864274, y: 0.32098746, z: 0.000000074505806} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: -1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -90 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &7479808252574595103 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9175217856303482155, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1766216186 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7479808252574595103} + serializedVersion: 2 + m_Mass: 3.125 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1766216187 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7479808252574595103} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.29406345, y: 0.541921, z: 0.29387283} + m_Center: {x: -0.1470294, y: 0.20822147, z: -0.0039490163} +--- !u!114 &1766216188 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7479808252574595103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0fbc699a0e80590478455ba80b87897b, type: 3} + m_Name: + m_EditorClassIdentifier: + follow: {fileID: 1772573266731274175} + rg: {fileID: 1766216186} +--- !u!1 &7698832226842829907 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8236748231002806631, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &808057160 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7698832226842829907} + serializedVersion: 2 + m_Mass: 1.25 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &808057162 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7698832226842829907} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.08023878 + m_Height: 0.32095513 + m_Direction: 1 + m_Center: {x: 0, y: 0.16047756, z: 0} +--- !u!144 &808057161 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7698832226842829907} + m_ConnectedBody: {fileID: 1814985531} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 0, z: -1} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.29387137, y: 0.3662702, z: -0.0017081703} + serializedVersion: 2 + m_SwingAxis: {x: -1, y: 0, z: 0} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -70 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 10 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 50 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!4 &8017009972647805438 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!1 &9039272608083888814 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7343263733104670618, guid: 7d85378c67373104c9c2627e9074c63d, + type: 3} + m_PrefabInstance: {fileID: 1772573268368440628} + m_PrefabAsset: {fileID: 0} +--- !u!54 &1814985531 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9039272608083888814} + serializedVersion: 2 + m_Mass: 3.125 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1814985533 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9039272608083888814} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.29386905, y: 0.54181564, z: 0.29387286} + m_Center: {x: 0.14693685, y: 0.095362425, z: -0.0035274029} +--- !u!144 &1814985532 +CharacterJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9039272608083888814} + m_ConnectedBody: {fileID: 1766216186} + m_ConnectedArticulationBody: {fileID: 0} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.0000023303473, y: 0.112771645, z: -0.00041861128} + serializedVersion: 2 + m_SwingAxis: {x: 0, y: 0, z: 1} + m_TwistLimitSpring: + spring: 0 + damper: 0 + m_LowTwistLimit: + limit: -20 + bounciness: 0 + contactDistance: 0 + m_HighTwistLimit: + limit: 20 + bounciness: 0 + contactDistance: 0 + m_SwingLimitSpring: + spring: 0 + damper: 0 + m_Swing1Limit: + limit: 10 + bounciness: 0 + contactDistance: 0 + m_Swing2Limit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_EnableProjection: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 diff --git a/Assets/Scenes/LevelDesign.unity b/Assets/Scenes/LevelDesign.unity index 3a07ff9..4001009 100644 --- a/Assets/Scenes/LevelDesign.unity +++ b/Assets/Scenes/LevelDesign.unity @@ -854,75 +854,6 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: f06e0b2bd426cc249b952a8f4e6711e5, type: 3} ---- !u!1001 &714208351 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1211811540} - m_Modifications: - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalPosition.y - value: -0.79 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalRotation.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalRotation.y - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: -180 - objectReference: {fileID: 0} - - target: {fileID: 8636591160554159306, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8975820612264765040, guid: 7d85378c67373104c9c2627e9074c63d, - type: 3} - propertyPath: m_Name - value: Thief - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7d85378c67373104c9c2627e9074c63d, type: 3} --- !u!1001 &770064676 PrefabInstance: m_ObjectHideFlags: 0 @@ -2799,21 +2730,6 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 1772573266731274163, guid: 4dbf735f9da7b9f43b69f1577e4e5763, - type: 3} - propertyPath: movementSpeed - value: 0.8 - objectReference: {fileID: 0} - - target: {fileID: 1772573266731274163, guid: 4dbf735f9da7b9f43b69f1577e4e5763, - type: 3} - propertyPath: maxMovementSpeed - value: 30 - objectReference: {fileID: 0} - - target: {fileID: 1772573266731274169, guid: 4dbf735f9da7b9f43b69f1577e4e5763, - type: 3} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - target: {fileID: 1772573266731274171, guid: 4dbf735f9da7b9f43b69f1577e4e5763, type: 3} propertyPath: m_Name @@ -2834,11 +2750,6 @@ PrefabInstance: propertyPath: hitMarkerRect value: objectReference: {fileID: 1301531513} - - target: {fileID: 1772573266731274174, guid: 4dbf735f9da7b9f43b69f1577e4e5763, - type: 3} - propertyPath: m_IsKinematic - value: 0 - objectReference: {fileID: 0} - target: {fileID: 1772573266731274175, guid: 4dbf735f9da7b9f43b69f1577e4e5763, type: 3} propertyPath: m_RootOrder @@ -2894,11 +2805,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 1772573266917019329, guid: 4dbf735f9da7b9f43b69f1577e4e5763, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4dbf735f9da7b9f43b69f1577e4e5763, type: 3} --- !u!1001 &5226806889855461982 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index e2b226a..e44e3a7 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -2,17 +2,21 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using Bytes.Sound; + public class PlayerController : MonoBehaviour { private GrappleHook grappleScript; private CharacterMovement movementScript; private Rigidbody rb; + SoundPlayer soundPlayer; // Start is called before the first frame update void Start() { rb = GetComponent(); grappleScript = GetComponent(); movementScript = GetComponent(); + soundPlayer = GetComponent(); } // Update is called once per frame @@ -24,6 +28,7 @@ public class PlayerController : MonoBehaviour public void Stun(float duration){ grappleScript.Stun(duration); movementScript.Stun(duration); + soundPlayer.PlaySound("PlayerHurt"); } public void Knockback(Vector2 dir){ diff --git a/Assets/Scripts/Ragdoll.cs b/Assets/Scripts/Ragdoll.cs index 7ada92c..aed06b2 100644 --- a/Assets/Scripts/Ragdoll.cs +++ b/Assets/Scripts/Ragdoll.cs @@ -13,25 +13,19 @@ public class Ragdoll : MonoBehaviour { [SerializeField] private bool _startsRagdolled; + [SerializeField] + private Transform _hipBone; + private List _ragdollRigidbodies; - private Animator _animator; - private Transform _hipBone; private bool _isRagdoll { get { return _ragdollRigidbodies != null && !_ragdollRigidbodies.Select(x => x.isKinematic).FirstOrDefault(); } } - // Start is called before the first frame update - private void Start() - { - } - private void Awake() { _ragdollRigidbodies = GetComponentsInChildren().ToList(); - _animator = GetComponent(); - _hipBone = _animator.GetBoneTransform(HumanBodyBones.Hips); void setRagdollState() { @@ -65,15 +59,19 @@ public class Ragdoll : MonoBehaviour } } } + private void EnableRagdoll() { _ragdollRigidbodies.ForEach(rigidbody => rigidbody.isKinematic = false); - _animator.enabled = false; } + private void DisableRagdoll() { - _ragdollRigidbodies.ForEach(rigidbody => rigidbody.isKinematic = true); - _animator.enabled = true; + _ragdollRigidbodies.ForEach(rigidbody => + { + rigidbody.isKinematic = true; + rigidbody.detectCollisions = true; + }); StandBackUp(); } @@ -95,6 +93,4 @@ public class Ragdoll : MonoBehaviour _hipBone.position = originalHipsPosition; } - - } diff --git a/Assets/Scripts/Sound.meta b/Assets/Scripts/Sound.meta new file mode 100644 index 0000000..80e9a23 --- /dev/null +++ b/Assets/Scripts/Sound.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dda7a3d8788479840bd85a0af58b3d15 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Sound/SoundPlayer.cs b/Assets/Scripts/Sound/SoundPlayer.cs new file mode 100644 index 0000000..4a133b7 --- /dev/null +++ b/Assets/Scripts/Sound/SoundPlayer.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Bytes.Sound +{ + [RequireComponent(typeof(AudioSource))] + public class SoundPlayer : MonoBehaviour + { + [SerializeField] private SoundTemplate[] playableSounds; + private Dictionary _playableSounds; + + private AudioSource _audioSource; + + private void Awake() + { + _audioSource = GetComponent(); + _playableSounds = new Dictionary(); + + foreach (var sound in playableSounds) + { + _playableSounds.Add(sound.name, sound); + } + } + + public void PlaySound(string soundName, float volumeMultiplier = 1f, float overrideVolume = -1f) + { + if (_playableSounds.TryGetValue(soundName, out SoundTemplate sound)) + { + _audioSource.clip = sound.GetRandomClip(); + _audioSource.pitch = sound.GetRandomPitch(); + _audioSource.volume = ((overrideVolume != -1f) ? overrideVolume : sound.volume) * volumeMultiplier; + _audioSource.Play(); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Sound/SoundPlayer.cs.meta b/Assets/Scripts/Sound/SoundPlayer.cs.meta new file mode 100644 index 0000000..7b5dd4e --- /dev/null +++ b/Assets/Scripts/Sound/SoundPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6fb36fee47a0d6a44bc2237dfbdac4d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Sound/SoundTemplate.cs b/Assets/Scripts/Sound/SoundTemplate.cs new file mode 100644 index 0000000..112ab3b --- /dev/null +++ b/Assets/Scripts/Sound/SoundTemplate.cs @@ -0,0 +1,29 @@ +using System.Collections; +using UnityEngine; + +namespace Bytes.Sound +{ + [CreateAssetMenu(fileName = "Sound", menuName = "SoundTemplate")] + public class SoundTemplate : ScriptableObject + { + [Header("Text")] + public new string name; + + [Header("Sound Data")] + [Tooltip("Sound variations if many.")] + public AudioClip[] clips; + public float volume = 1f; + [Tooltip("Max Random pitch change.")] + public float maxRandomPitchChange = 0.02f; + + public AudioClip GetRandomClip() + { + return clips[Random.Range(0, clips.Length)]; + } + + public float GetRandomPitch() + { + return 1f + Random.Range(-maxRandomPitchChange, maxRandomPitchChange); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Sound/SoundTemplate.cs.meta b/Assets/Scripts/Sound/SoundTemplate.cs.meta new file mode 100644 index 0000000..96f59bf --- /dev/null +++ b/Assets/Scripts/Sound/SoundTemplate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5baf129b10beab41b82ab310fd176e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SoundPlayerHurt.asset b/Assets/SoundPlayerHurt.asset new file mode 100644 index 0000000..9f442cb --- /dev/null +++ b/Assets/SoundPlayerHurt.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f5baf129b10beab41b82ab310fd176e2, type: 3} + m_Name: SoundPlayerHurt + m_EditorClassIdentifier: + name: PlayerHurt + clips: + - {fileID: 0} + volume: 1 + maxRandomPitchChange: 0.02 diff --git a/Assets/SoundPlayerHurt.asset.meta b/Assets/SoundPlayerHurt.asset.meta new file mode 100644 index 0000000..93f4a35 --- /dev/null +++ b/Assets/SoundPlayerHurt.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 973ba6a42810a6b42807bf7ef7fe13a1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index 6bc5090..750ad30 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -18,7 +18,7 @@ PhysicsManager: m_ClothInterCollisionDistance: 0.1 m_ClothInterCollisionStiffness: 0.2 m_ContactsGeneration: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_AutoSimulation: 1 m_AutoSyncTransforms: 0 m_ReuseCollisionCallbacks: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 9889ccb..08de597 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -14,8 +14,8 @@ TagManager: - UI - Grappleable - Stun - - - - + - Player + - PlayerRagdoll - - -