diff --git a/Assets/Animations/Bones/Bones.controller b/Assets/Animations/Bones/Bones.controller index a3c7568..c9573ff 100644 --- a/Assets/Animations/Bones/Bones.controller +++ b/Assets/Animations/Bones/Bones.controller @@ -229,6 +229,9 @@ AnimatorStateMachine: - serializedVersion: 1 m_State: {fileID: -6105423640591385822} m_Position: {x: -90, y: 230, z: 0} + - serializedVersion: 1 + m_State: {fileID: 2419565110853745188} + m_Position: {x: -55, y: 295, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: - {fileID: 5263795009836994554} @@ -413,6 +416,32 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1102 &2419565110853745188 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Die + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: f81637d914d3dde469fd4b25e1d67a76, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!1102 &2500419510660092995 AnimatorState: serializedVersion: 6 diff --git a/Assets/Animations/Die.anim b/Assets/Animations/Die.anim new file mode 100644 index 0000000..5fe9f63 --- /dev/null +++ b/Assets/Animations/Die.anim @@ -0,0 +1,1653 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Die + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Arm L + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 39.379} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 39.379} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Arm L/Arm L L + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Arm R + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 37.289} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 37.289} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Arm R/Arm R L + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 180} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Head + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 187.66} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 187.66} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Leg L U + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: -8.544} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: -8.544} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Leg L U/Leg L L + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 181.021} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: 181.021} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Leg R U + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: -6.177} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: 0, z: -6.177} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Torso/Leg R U/Leg R L + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 3869152129 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4207337212 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 621932707 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 13231007 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1470883642 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2146230158 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 596276160 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 415537218 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 892534202 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4076665333 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 39.379 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 39.379 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 37.289 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 37.289 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 180 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 187.66 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 187.66 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -8.544 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: -8.544 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 181.021 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 181.021 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -6.177 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: -6.177 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + m_EulerEditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Leg L U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Leg R U + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Leg L U/Leg L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Arm L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Arm L/Arm L L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Arm R + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Arm R/Arm R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Head + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Torso/Leg R U/Leg R L + classID: 4 + script: {fileID: 0} + flags: 0 + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Animations/Die.anim.meta b/Assets/Animations/Die.anim.meta new file mode 100644 index 0000000..30ebda6 --- /dev/null +++ b/Assets/Animations/Die.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f81637d914d3dde469fd4b25e1d67a76 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Old/Hub/HubManager.cs b/Assets/Old/Hub/HubManager.cs index ab194c6..c0dc250 100644 --- a/Assets/Old/Hub/HubManager.cs +++ b/Assets/Old/Hub/HubManager.cs @@ -1,3 +1,4 @@ +using System.Linq; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; @@ -6,7 +7,6 @@ using UnityEngine.UI; public class HubManager : MonoBehaviour { public static HubManager Instance; - public GameObject hubCamera; public GameObject gameButtonsParent; @@ -52,7 +52,8 @@ public class HubManager : MonoBehaviour { UnloadGameScene(); ChangeGameButtonsInteractability(true); - foreach (GameObject player in GameManager.players) + + foreach (GameObject player in GameManager.players.ToList()) { GameManager.players.Remove(player); Destroy(player); diff --git a/Assets/Prefabs/Healthbar.prefab b/Assets/Prefabs/Healthbar.prefab index 9843f4f..0e2147a 100644 --- a/Assets/Prefabs/Healthbar.prefab +++ b/Assets/Prefabs/Healthbar.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 210773656378718009} - component: {fileID: 210773656378718014} - m_Layer: 0 + m_Layer: 7 m_Name: Death m_TagString: Untagged m_Icon: {fileID: 0} @@ -97,7 +97,7 @@ GameObject: m_Component: - component: {fileID: 210773656934484430} - component: {fileID: 210773656934484428} - m_Layer: 0 + m_Layer: 7 m_Name: Health m_TagString: Untagged m_Icon: {fileID: 0} @@ -184,21 +184,20 @@ GameObject: m_Component: - component: {fileID: 210773657359985456} - component: {fileID: 7422290698914274434} - m_Layer: 0 + m_Layer: 7 m_Name: Healthbar m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &210773657359985456 -Transform: +--- !u!224 &210773657359985456 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 210773657359985459} - serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -211,6 +210,11 @@ Transform: - {fileID: 210773657761048651} m_Father: {fileID: 0} 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: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &7422290698914274434 MonoBehaviour: m_ObjectHideFlags: 0 @@ -231,6 +235,7 @@ MonoBehaviour: deathVisual: {fileID: 210773656378718008} smoothSpeed: 0.1 text: {fileID: 210773657480500664} + player: {fileID: 0} --- !u!1 &210773657480500666 GameObject: m_ObjectHideFlags: 0 @@ -242,7 +247,7 @@ GameObject: - component: {fileID: 210773657480500667} - component: {fileID: 210773657480500665} - component: {fileID: 210773657480500664} - m_Layer: 0 + m_Layer: 7 m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} @@ -377,7 +382,7 @@ GameObject: m_Component: - component: {fileID: 210773657645469775} - component: {fileID: 210773657645469772} - m_Layer: 0 + m_Layer: 7 m_Name: Border m_TagString: Untagged m_Icon: {fileID: 0} @@ -466,7 +471,7 @@ GameObject: - component: {fileID: 210773657761048654} - component: {fileID: 210773657761048649} - component: {fileID: 210773657761048648} - m_Layer: 0 + m_Layer: 7 m_Name: Number m_TagString: Untagged m_Icon: {fileID: 0} @@ -566,7 +571,7 @@ GameObject: m_Component: - component: {fileID: 170974732944509535} - component: {fileID: 8850558015437586293} - m_Layer: 0 + m_Layer: 7 m_Name: Actual m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 627cf8d..9b25ba7 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -100,7 +100,7 @@ GameObject: - component: {fileID: -5768905494704828194} m_Layer: 0 m_Name: Player - m_TagString: Player + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -411,3 +411,5 @@ MonoBehaviour: m_EditorClassIdentifier: teleportPoint: {x: 0, y: 0} teleportTag: Teleporter + playerTag: Player + isPlatform: 1 diff --git a/Assets/Scenes/Platformer With Headroom.unity b/Assets/Scenes/Platformer With Headroom.unity index ef272c0..d7bd7bc 100644 --- a/Assets/Scenes/Platformer With Headroom.unity +++ b/Assets/Scenes/Platformer With Headroom.unity @@ -304,6 +304,133 @@ Transform: m_CorrespondingSourceObject: {fileID: 5794044177371189323, guid: 5ce441c5fe33344a292ef80ef22aaffd, type: 3} m_PrefabInstance: {fileID: 612903695} m_PrefabAsset: {fileID: 0} +--- !u!1001 &646086199 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1703536538} + m_Modifications: + - target: {fileID: 210773656378718008, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 210773656934484425, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_AnchoredPosition.x + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_AnchoredPosition.y + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 210773657359985459, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Name + value: Healthbar + objectReference: {fileID: 0} + - target: {fileID: 210773657359985459, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 210773657480500666, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 210773657645469774, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 210773657761048650, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 904379579236604940, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_Layer + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 1847290122477952015, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: m_PresetInfoIsWorld + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7422290698914274434, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + propertyPath: player + value: + objectReference: {fileID: 1375850422501237868, guid: 1fd31b88e5609482ab7e8ab16a932947, type: 3} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 210773657359985459, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + insertIndex: -1 + addedObject: {fileID: 646086201} + m_SourcePrefab: {fileID: 100100000, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} +--- !u!1 &646086200 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 210773657359985459, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + m_PrefabInstance: {fileID: 646086199} + m_PrefabAsset: {fileID: 0} +--- !u!114 &646086201 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 646086200} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a80b536f823e50142b142b4e0b64ea97, type: 3} + m_Name: + m_EditorClassIdentifier: + healthBarPrefab: {fileID: 646086200} +--- !u!224 &646086202 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + m_PrefabInstance: {fileID: 646086199} + m_PrefabAsset: {fileID: 0} --- !u!1 &708097981 GameObject: m_ObjectHideFlags: 0 @@ -888,87 +1015,90 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: eea49ffcaef404cf0b373413357af83b, type: 3} ---- !u!1001 &1664848898 -PrefabInstance: +--- !u!1 &1703536534 +GameObject: m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalScale.x - value: 10.396 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalScale.y - value: 10.396 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalScale.z - value: 10.396 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalPosition.x - value: -12.83 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalPosition.y - value: 3.96 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985456, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 210773657359985459, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_Name - value: Healthbar - objectReference: {fileID: 0} - - target: {fileID: 210773657480500664, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_fontAsset - value: - objectReference: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - - target: {fileID: 210773657480500664, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: m_sharedMaterial - value: - objectReference: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - - target: {fileID: 210773657480500664, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} - propertyPath: 'm_ActiveFontFeatures.Array.data[0]' - value: 1801810542 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: e2f1088617eeb46c79bf9d357f913fc4, type: 3} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703536538} + - component: {fileID: 1703536537} + - component: {fileID: 1703536536} + m_Layer: 5 + m_Name: HealthCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1703536536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703536534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1703536537 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703536534} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 10000 + m_TargetDisplay: 0 +--- !u!224 &1703536538 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703536534} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 646086202} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &1758254987 GameObject: m_ObjectHideFlags: 0 @@ -4619,6 +4749,7 @@ SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 8682934954266721942} + - {fileID: 1703536538} - {fileID: 1758254989} - {fileID: 1335742587} - {fileID: 2119246465} @@ -4627,4 +4758,3 @@ SceneRoots: - {fileID: 421411299} - {fileID: 708097985} - {fileID: 854334845} - - {fileID: 1664848898} diff --git a/Assets/Scripts/AnimationPlayer.cs b/Assets/Scripts/AnimationPlayer.cs index 40cda6b..1bc7102 100644 --- a/Assets/Scripts/AnimationPlayer.cs +++ b/Assets/Scripts/AnimationPlayer.cs @@ -24,7 +24,6 @@ public class AnimationPlayer : MonoBehaviour { animator.SetInteger("state", (int)state); transform.localScale = new Vector3(Mathf.Sign(backwards ? -1 : 1) * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); - animator.SetBool("block", block); } diff --git a/Assets/Scripts/Damageable.cs b/Assets/Scripts/Damageable.cs index b588568..9098c7f 100644 --- a/Assets/Scripts/Damageable.cs +++ b/Assets/Scripts/Damageable.cs @@ -1,3 +1,5 @@ +using System.Collections; +using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(Rigidbody2D))] @@ -8,19 +10,13 @@ public class Damageable : MonoBehaviour public float force = 50f; public float damage = 0f; public float maxDamage = 1000f; - public HealthBar healthBar; - private GameManager gameManager; + private Animator animator; private void Start() { gameManager = GameManager.Instance; - - if (healthBar != null) - { - healthBar.SetMaxHealth(maxDamage); - healthBar.SetHealth(maxDamage - damage); - } + animator = GetComponent(); } private void OnTriggerEnter2D(Collider2D collision) @@ -55,10 +51,6 @@ public class Damageable : MonoBehaviour } damage += actualForce; damage = Mathf.Clamp(damage, 0f, maxDamage); - if (healthBar != null) - { - healthBar.SetHealth(maxDamage - damage); - } if (damage >= maxDamage) { Die(); @@ -70,10 +62,6 @@ public class Damageable : MonoBehaviour GetComponent().AddForce(((transform.position - damageSource.transform.position).normalized + Vector3.up * 2) * force, ForceMode2D.Force); damage += force; damage = Mathf.Clamp(damage, 0f, maxDamage); - if (healthBar != null) - { - healthBar.SetHealth(maxDamage - damage); - } if (damage >= maxDamage) { Die(); @@ -82,12 +70,18 @@ public class Damageable : MonoBehaviour private void Die() { + Debug.Log($"{name}: MAKE THIS WORK."); if (gameManager != null) { - gameManager.PlayerDied(gameObject); //add death animation trigger + animator.SetTrigger("Die"); + StartCoroutine(HandleDeath()); } + } - + private IEnumerator HandleDeath() + { + yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length); + gameManager.PlayerDied(gameObject); } public void Respawn() @@ -96,6 +90,7 @@ public class Damageable : MonoBehaviour if (TryGetComponent(out var rb)) { rb.linearVelocity = Vector2.zero; + rb.angularVelocity = 0f; } if (TryGetComponent(out var damageable)) { @@ -106,10 +101,5 @@ public class Damageable : MonoBehaviour public void ResetDamage() { damage = 0f; - if (healthBar != null) - { - healthBar.SetHealth(maxDamage); - } - //transform.localScale = Vector3.one; } } diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 082165b..9f115c3 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -6,6 +6,10 @@ public class GameManager : MonoBehaviour public static GameManager Instance { get; private set; } public int maxLives = 3; public int currentLives; + public delegate void GameEvent(); + public event GameEvent StartGameEvent; + public event GameEvent EndGameEvent; + public static List players = new List(); private void Awake() { @@ -26,21 +30,31 @@ public class GameManager : MonoBehaviour public void StartGame() { + StartGameEvent?.Invoke(); print("Starting game with mode: " + gameMode + " and map: " + map); if (gameMode == GameMode.freeForAll) { currentLives = maxLives; - StartFreeForAll(); + foreach (GameObject player in players) + { + player.transform.position = spawnPosition; + } } if (gameMode == GameMode.keepAway) { currentLives = 1; - StartKeepAway(); + foreach (GameObject player in players) + { + player.transform.position = spawnPosition; + } } if (gameMode == GameMode.obstacleCourse) { currentLives = 1; - StartObstacleCourse(); + foreach (GameObject player in players) + { + player.transform.position = spawnPosition; + } } } @@ -51,38 +65,10 @@ public class GameManager : MonoBehaviour obstacleCourse } - public static GameMode gameMode = GameMode.freeForAll; - - public static string map = "Platformer With Headroom"; //called for in PlayerManager and should be changed to load from here instead - - public static List players = new List(); - + public static GameMode gameMode = GameMode.freeForAll; // loads a default gamemode as a safety net + public static string map = "Platformer With Headroom"; // loads a default map as a safety net public Vector2 spawnPosition; - private void StartFreeForAll() - { - foreach (GameObject player in players) - { - player.transform.position = spawnPosition; - } - } - - private void StartKeepAway() - { - foreach (GameObject player in players) - { - player.transform.position = spawnPosition; - } - } - - private void StartObstacleCourse() - { - foreach (GameObject player in players) - { - player.transform.position = spawnPosition; - } - } - public void PlayerDied(GameObject player) { if (gameMode == GameMode.freeForAll) @@ -119,7 +105,8 @@ public class GameManager : MonoBehaviour private void GameOver(GameObject player) { - // Disable player controls and show game over screen + // Add game over screen player.SetActive(false); + EndGameEvent?.Invoke(); } } diff --git a/Assets/Scripts/HealthBar.cs b/Assets/Scripts/HealthBar.cs deleted file mode 100644 index d521dcb..0000000 --- a/Assets/Scripts/HealthBar.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -public class HealthBar : MonoBehaviour -{ - public Slider slider; - - public void SetMaxHealth(float health) - { - if (slider != null) - { - slider.maxValue = health; - slider.value = health; - } - } - - public void SetHealth(float health) - { - if (slider != null) - { - slider.value = health; - } - } -} diff --git a/Assets/Scripts/HealthBar.cs.meta b/Assets/Scripts/HealthBar.cs.meta deleted file mode 100644 index f8163e4..0000000 --- a/Assets/Scripts/HealthBar.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 15c35eadf0afb0e42a41e4d6f5350554 \ No newline at end of file diff --git a/Assets/Scripts/HealthBarManager.cs b/Assets/Scripts/HealthBarManager.cs new file mode 100644 index 0000000..abf2e04 --- /dev/null +++ b/Assets/Scripts/HealthBarManager.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using UnityEngine; + +public class HealthBarManager : MonoBehaviour +{ + public GameObject healthBarPrefab; + private Dictionary playerHealthBars = new Dictionary(); + + void Start() + { + GameManager.Instance.StartGameEvent += OnGameStart; + GameManager.Instance.EndGameEvent += OnGameEnd; + } + + void OnDestroy() + { + GameManager.Instance.StartGameEvent -= OnGameStart; + GameManager.Instance.EndGameEvent -= OnGameEnd; + } + + void Update() + { + foreach (var kvp in playerHealthBars) + { + GameObject player = kvp.Key; + GameObject healthBar = kvp.Value; + Vector3 screenPosition = Camera.main.WorldToScreenPoint(player.transform.position); + screenPosition.y += 15; + Vector3 worldPosition = Camera.main.ScreenToWorldPoint(screenPosition); + healthBar.transform.position = worldPosition; + healthBar.transform.rotation = Quaternion.identity; + } + } + + private void OnGameStart() + { + foreach (GameObject player in GameManager.players) + { + if (!playerHealthBars.ContainsKey(player)) + { + GameObject healthBar = Instantiate(healthBarPrefab); + healthBar.GetComponent().SetPlayer(player); + playerHealthBars[player] = healthBar; + } + } + } + + private void OnGameEnd() + { + foreach (var kvp in playerHealthBars) + { + Destroy(kvp.Value); + } + playerHealthBars.Clear(); + } +} diff --git a/Assets/Scripts/HealthBarManager.cs.meta b/Assets/Scripts/HealthBarManager.cs.meta new file mode 100644 index 0000000..9513a4f --- /dev/null +++ b/Assets/Scripts/HealthBarManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a80b536f823e50142b142b4e0b64ea97 \ No newline at end of file diff --git a/Assets/Scripts/PlayerManager.cs b/Assets/Scripts/PlayerManager.cs index 6907d86..1d5418d 100644 --- a/Assets/Scripts/PlayerManager.cs +++ b/Assets/Scripts/PlayerManager.cs @@ -5,15 +5,12 @@ using UnityEngine.InputSystem; public class PlayerManager : MonoBehaviour { public static PlayerManager Instance; - public List cards; [SerializeField] private InputActionAsset playerActions; - public List playerColors; - public GameObject playerSelect; - private bool gameStarted = false; + private bool isStartPressed = false; private void Awake() { @@ -34,17 +31,12 @@ public class PlayerManager : MonoBehaviour Destroy(playerInput.gameObject); return; } - Debug.Log("Player joined"); - DontDestroyOnLoad(playerInput.gameObject); - PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard(); card.playerNumber = GameManager.players.Count + 1; cards.Add(card); - GameManager.players.Add(playerInput.gameObject); - Colorize(GameManager.players.Count - 1); } @@ -63,26 +55,33 @@ public class PlayerManager : MonoBehaviour } else { - Debug.Log("A PlayerManager already exists."); Destroy(this.gameObject); } } public void StartGame() { - gameStarted = true; - Debug.Log("Game started"); - HubManager.Instance.LoadScene(GameManager.map); + if (GameManager.players.Count == 0) + { + return; + } + if (isStartPressed) + { + gameStarted = true; + HubManager.Instance.LoadScene(GameManager.map); + } + else + { + isStartPressed = true; + } } private void Colorize(int index) { GameObject player = GameManager.players[index]; - Color color = playerColors[(GameManager.players.Count - 1) % playerColors.Count]; float tint = Mathf.Floor((GameManager.players.Count - 1) / playerColors.Count); color = (color + color + Color.white * tint) / (tint + 2); - ApplyColor(player, color); ApplyColor(cards[GameManager.players.IndexOf(player)].playerPreview, color); } @@ -101,4 +100,4 @@ public class PlayerManager : MonoBehaviour } } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/RespawnOnTriggerEnter.cs b/Assets/Scripts/RespawnOnTriggerEnter.cs index 8b666b4..5e5f4b9 100644 --- a/Assets/Scripts/RespawnOnTriggerEnter.cs +++ b/Assets/Scripts/RespawnOnTriggerEnter.cs @@ -21,4 +21,4 @@ public class RespawnOnTriggerEnter : MonoBehaviour GetComponent().Respawn(); } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/TerribleHealthBarScript.cs b/Assets/Scripts/TerribleHealthBarScript.cs index 2b1d21b..4c69b56 100644 --- a/Assets/Scripts/TerribleHealthBarScript.cs +++ b/Assets/Scripts/TerribleHealthBarScript.cs @@ -21,45 +21,64 @@ public class TerribleHealthBarScript : MonoBehaviour private Vector3 targetPosition; private Color targetActualColor; - private Damageable player; + public GameObject player; void Start() { - + if (player == null) + { + return; + } healthScript = player.GetComponent(); - initialScale = healthVisual.transform.localScale; - initialPosition = healthVisual.transform.position; - targetScale = initialScale; - targetPosition = initialPosition; - targetActualColor = actualHealthVisual.GetComponent().color; + if (healthScript == null) + { + return; + } + Initialize(); } void Update() { - if (healthScript.gameObject.transform.localScale.x <= 0f) + if (player == null || healthScript == null) { - transform.localScale = new Vector3(-1 * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); + return; } - else - { - transform.localScale = new Vector3(1 * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); - }// - float healthRatio = (healthScript.maxDamage - healthScript.damage) / healthScript.maxDamage; targetActualColor = Color.Lerp(fullDeathColor, fullHealthColor, healthRatio); targetScale = new Vector3(Mathf.Lerp(0, 1, healthRatio) * initialScale.x, healthVisual.transform.localScale.y, healthVisual.transform.localScale.z); targetPosition = new Vector3(Mathf.Lerp(-0.5f, 0, healthRatio), healthVisual.transform.localPosition.y, healthVisual.transform.localPosition.z); text.text = (healthScript.maxDamage - healthScript.damage).ToString() + "/" + healthScript.maxDamage.ToString(); - actualHealthVisual.transform.localScale = targetScale; actualHealthVisual.transform.localPosition = targetPosition; - healthVisual.transform.localScale = Vector3.Lerp(healthVisual.transform.localScale, targetScale, smoothSpeed); healthVisual.transform.localPosition = Vector3.Lerp(healthVisual.transform.localPosition, targetPosition, smoothSpeed); - actualHealthVisual.GetComponent().color = Color.Lerp(actualHealthVisual.GetComponent().color, targetActualColor, smoothSpeed); deathVisual.GetComponent().color = Color.Lerp(deathVisual.GetComponent().color, targetActualColor * 0.5f, smoothSpeed); healthVisual.GetComponent().color = subtractionColor; } + + public void SetPlayer(GameObject player) + { + this.player = player; + if (this.player == null) + { + return; + } + healthScript = player.GetComponent(); + if (healthScript == null) + { + return; + } + Initialize(); + } + + private void Initialize() + { + initialScale = healthVisual.transform.localScale; + initialPosition = healthVisual.transform.position; + targetScale = initialScale; + targetPosition = initialPosition; + targetActualColor = actualHealthVisual.GetComponent().color; + } } diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 1edca89..b9b7f0f 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -18,7 +18,7 @@ TagManager: - Water - UI - Platformer Ground - - + - HealthBar - - - @@ -68,5 +68,8 @@ TagManager: - name: Ground uniqueID: 1556569731 locked: 0 + - name: HealthBar + uniqueID: 1570397069 + locked: 0 m_RenderingLayers: - Default