feat: Phase 1 complete - attack system, enemy damage, timers, and study notes summary
This commit is contained in:
@@ -1,5 +1,30 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1101 &-8820503692433972253
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions:
|
||||||
|
- m_ConditionMode: 1
|
||||||
|
m_ConditionEvent: attack
|
||||||
|
m_EventTreshold: 0
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 4761740218506164828}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 0.61206895
|
||||||
|
m_HasExitTime: 0
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 1
|
||||||
--- !u!1107 &-7853685596089614426
|
--- !u!1107 &-7853685596089614426
|
||||||
AnimatorStateMachine:
|
AnimatorStateMachine:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
@@ -10,11 +35,14 @@ AnimatorStateMachine:
|
|||||||
m_Name: Base Layer
|
m_Name: Base Layer
|
||||||
m_ChildStates:
|
m_ChildStates:
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: -2999887273125739820}
|
m_State: {fileID: 8428018393159066403}
|
||||||
m_Position: {x: 320, y: 40, z: 0}
|
m_Position: {x: 550, y: 110, z: 0}
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: 8541810184871255671}
|
m_State: {fileID: 2731809886444445990}
|
||||||
m_Position: {x: 315, y: 175, z: 0}
|
m_Position: {x: 270, y: 110, z: 0}
|
||||||
|
- serializedVersion: 1
|
||||||
|
m_State: {fileID: 4761740218506164828}
|
||||||
|
m_Position: {x: 270, y: 230, z: 0}
|
||||||
m_ChildStateMachines: []
|
m_ChildStateMachines: []
|
||||||
m_AnyStateTransitions: []
|
m_AnyStateTransitions: []
|
||||||
m_EntryTransitions: []
|
m_EntryTransitions: []
|
||||||
@@ -22,37 +50,41 @@ AnimatorStateMachine:
|
|||||||
m_StateMachineBehaviours: []
|
m_StateMachineBehaviours: []
|
||||||
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
||||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||||
m_ExitPosition: {x: 610, y: 110, z: 0}
|
m_ExitPosition: {x: 770, y: 90, z: 0}
|
||||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||||
m_DefaultState: {fileID: -2999887273125739820}
|
m_DefaultState: {fileID: 2731809886444445990}
|
||||||
--- !u!1102 &-2999887273125739820
|
--- !u!206 &-7108901356451733881
|
||||||
AnimatorState:
|
BlendTree:
|
||||||
serializedVersion: 6
|
|
||||||
m_ObjectHideFlags: 1
|
m_ObjectHideFlags: 1
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: playerIdle
|
m_Name: Blend Tree
|
||||||
m_Speed: 1
|
m_Childs:
|
||||||
m_CycleOffset: 0
|
- serializedVersion: 2
|
||||||
m_Transitions:
|
m_Motion: {fileID: 7400000, guid: 122b1fcaba4d2944e908c03459129cbf, type: 2}
|
||||||
- {fileID: -1263164013022993944}
|
m_Threshold: -1
|
||||||
m_StateMachineBehaviours: []
|
m_Position: {x: 0, y: 0}
|
||||||
m_Position: {x: 50, y: 50, z: 0}
|
m_TimeScale: 1
|
||||||
m_IKOnFeet: 0
|
m_CycleOffset: 0
|
||||||
m_WriteDefaultValues: 1
|
m_DirectBlendParameter: Blend
|
||||||
m_Mirror: 0
|
m_Mirror: 0
|
||||||
m_SpeedParameterActive: 0
|
- serializedVersion: 2
|
||||||
m_MirrorParameterActive: 0
|
m_Motion: {fileID: 7400000, guid: d11062b0858b3c64cb6c4406048bbd03, type: 2}
|
||||||
m_CycleOffsetParameterActive: 0
|
m_Threshold: 1
|
||||||
m_TimeParameterActive: 0
|
m_Position: {x: 0, y: 0}
|
||||||
m_Motion: {fileID: 7400000, guid: fe96eea6ebc2c8b4dbe787f4b59ef43f, type: 2}
|
m_TimeScale: 1
|
||||||
m_Tag:
|
m_CycleOffset: 0
|
||||||
m_SpeedParameter:
|
m_DirectBlendParameter: Blend
|
||||||
m_MirrorParameter:
|
m_Mirror: 0
|
||||||
m_CycleOffsetParameter:
|
m_BlendParameter: yVelocity
|
||||||
m_TimeParameter:
|
m_BlendParameterY: Blend
|
||||||
--- !u!1101 &-1263164013022993944
|
m_MinThreshold: -1
|
||||||
|
m_MaxThreshold: 1
|
||||||
|
m_UseAutomaticThresholds: 0
|
||||||
|
m_NormalizedBlendValues: 0
|
||||||
|
m_BlendType: 0
|
||||||
|
--- !u!1101 &-1775290645410636153
|
||||||
AnimatorStateTransition:
|
AnimatorStateTransition:
|
||||||
m_ObjectHideFlags: 1
|
m_ObjectHideFlags: 1
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -60,23 +92,62 @@ AnimatorStateTransition:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_Conditions:
|
m_Conditions:
|
||||||
- m_ConditionMode: 1
|
- m_ConditionMode: 2
|
||||||
m_ConditionEvent: isMoving
|
m_ConditionEvent: isGrounded
|
||||||
m_EventTreshold: 0
|
m_EventTreshold: 0
|
||||||
m_DstStateMachine: {fileID: 0}
|
m_DstStateMachine: {fileID: 0}
|
||||||
m_DstState: {fileID: 8541810184871255671}
|
m_DstState: {fileID: 8428018393159066403}
|
||||||
m_Solo: 0
|
m_Solo: 0
|
||||||
m_Mute: 0
|
m_Mute: 0
|
||||||
m_IsExit: 0
|
m_IsExit: 0
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TransitionDuration: 0
|
m_TransitionDuration: 0
|
||||||
m_TransitionOffset: 0
|
m_TransitionOffset: 0
|
||||||
m_ExitTime: 0.5833334
|
m_ExitTime: 0.61206895
|
||||||
m_HasExitTime: 0
|
m_HasExitTime: 0
|
||||||
m_HasFixedDuration: 1
|
m_HasFixedDuration: 1
|
||||||
m_InterruptionSource: 0
|
m_InterruptionSource: 0
|
||||||
m_OrderedInterruption: 1
|
m_OrderedInterruption: 1
|
||||||
m_CanTransitionToSelf: 1
|
m_CanTransitionToSelf: 1
|
||||||
|
--- !u!206 &-1313122025294676891
|
||||||
|
BlendTree:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Blend Tree
|
||||||
|
m_Childs:
|
||||||
|
- serializedVersion: 2
|
||||||
|
m_Motion: {fileID: 7400000, guid: ac4d453786085a145949201d8c33f0e0, type: 2}
|
||||||
|
m_Threshold: -1
|
||||||
|
m_Position: {x: 0, y: 0}
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_DirectBlendParameter: yVelocity
|
||||||
|
m_Mirror: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
m_Motion: {fileID: 7400000, guid: fe96eea6ebc2c8b4dbe787f4b59ef43f, type: 2}
|
||||||
|
m_Threshold: 0
|
||||||
|
m_Position: {x: 0, y: 0}
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_DirectBlendParameter: yVelocity
|
||||||
|
m_Mirror: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
m_Motion: {fileID: 7400000, guid: ac4d453786085a145949201d8c33f0e0, type: 2}
|
||||||
|
m_Threshold: 1
|
||||||
|
m_Position: {x: 0, y: 0}
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_DirectBlendParameter: yVelocity
|
||||||
|
m_Mirror: 0
|
||||||
|
m_BlendParameter: xVelocity
|
||||||
|
m_BlendParameterY: yVelocity
|
||||||
|
m_MinThreshold: -1
|
||||||
|
m_MaxThreshold: 1
|
||||||
|
m_UseAutomaticThresholds: 0
|
||||||
|
m_NormalizedBlendValues: 0
|
||||||
|
m_BlendType: 0
|
||||||
--- !u!91 &9100000
|
--- !u!91 &9100000
|
||||||
AnimatorController:
|
AnimatorController:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -86,12 +157,30 @@ AnimatorController:
|
|||||||
m_Name: Player
|
m_Name: Player
|
||||||
serializedVersion: 5
|
serializedVersion: 5
|
||||||
m_AnimatorParameters:
|
m_AnimatorParameters:
|
||||||
- m_Name: isMoving
|
- m_Name: isGrounded
|
||||||
m_Type: 4
|
m_Type: 4
|
||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 9100000}
|
||||||
|
- m_Name: yVelocity
|
||||||
|
m_Type: 1
|
||||||
|
m_DefaultFloat: 0
|
||||||
|
m_DefaultInt: 0
|
||||||
|
m_DefaultBool: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
|
- m_Name: xVelocity
|
||||||
|
m_Type: 1
|
||||||
|
m_DefaultFloat: 0
|
||||||
|
m_DefaultInt: 0
|
||||||
|
m_DefaultBool: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
|
- m_Name: attack
|
||||||
|
m_Type: 9
|
||||||
|
m_DefaultFloat: 0
|
||||||
|
m_DefaultInt: 0
|
||||||
|
m_DefaultBool: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
m_AnimatorLayers:
|
m_AnimatorLayers:
|
||||||
- serializedVersion: 5
|
- serializedVersion: 5
|
||||||
m_Name: Base Layer
|
m_Name: Base Layer
|
||||||
@@ -105,7 +194,7 @@ AnimatorController:
|
|||||||
m_IKPass: 0
|
m_IKPass: 0
|
||||||
m_SyncedLayerAffectsTiming: 0
|
m_SyncedLayerAffectsTiming: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 9100000}
|
||||||
--- !u!1101 &7343199574911539791
|
--- !u!1101 &563274122570338863
|
||||||
AnimatorStateTransition:
|
AnimatorStateTransition:
|
||||||
m_ObjectHideFlags: 1
|
m_ObjectHideFlags: 1
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -113,35 +202,36 @@ AnimatorStateTransition:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_Conditions:
|
m_Conditions:
|
||||||
- m_ConditionMode: 2
|
- m_ConditionMode: 1
|
||||||
m_ConditionEvent: isMoving
|
m_ConditionEvent: isGrounded
|
||||||
m_EventTreshold: 0
|
m_EventTreshold: 0
|
||||||
m_DstStateMachine: {fileID: 0}
|
m_DstStateMachine: {fileID: 0}
|
||||||
m_DstState: {fileID: -2999887273125739820}
|
m_DstState: {fileID: 2731809886444445990}
|
||||||
m_Solo: 0
|
m_Solo: 0
|
||||||
m_Mute: 0
|
m_Mute: 0
|
||||||
m_IsExit: 0
|
m_IsExit: 0
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TransitionDuration: 0
|
m_TransitionDuration: 0
|
||||||
m_TransitionOffset: 0
|
m_TransitionOffset: 0
|
||||||
m_ExitTime: 0.625
|
m_ExitTime: 0.1428572
|
||||||
m_HasExitTime: 0
|
m_HasExitTime: 0
|
||||||
m_HasFixedDuration: 1
|
m_HasFixedDuration: 1
|
||||||
m_InterruptionSource: 0
|
m_InterruptionSource: 0
|
||||||
m_OrderedInterruption: 1
|
m_OrderedInterruption: 1
|
||||||
m_CanTransitionToSelf: 1
|
m_CanTransitionToSelf: 1
|
||||||
--- !u!1102 &8541810184871255671
|
--- !u!1102 &2731809886444445990
|
||||||
AnimatorState:
|
AnimatorState:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_ObjectHideFlags: 1
|
m_ObjectHideFlags: 1
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: PlayerMove
|
m_Name: idle/move
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions:
|
m_Transitions:
|
||||||
- {fileID: 7343199574911539791}
|
- {fileID: -1775290645410636153}
|
||||||
|
- {fileID: -8820503692433972253}
|
||||||
m_StateMachineBehaviours: []
|
m_StateMachineBehaviours: []
|
||||||
m_Position: {x: 50, y: 50, z: 0}
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
m_IKOnFeet: 0
|
m_IKOnFeet: 0
|
||||||
@@ -151,7 +241,83 @@ AnimatorState:
|
|||||||
m_MirrorParameterActive: 0
|
m_MirrorParameterActive: 0
|
||||||
m_CycleOffsetParameterActive: 0
|
m_CycleOffsetParameterActive: 0
|
||||||
m_TimeParameterActive: 0
|
m_TimeParameterActive: 0
|
||||||
m_Motion: {fileID: 7400000, guid: ac4d453786085a145949201d8c33f0e0, type: 2}
|
m_Motion: {fileID: -1313122025294676891}
|
||||||
|
m_Tag:
|
||||||
|
m_SpeedParameter:
|
||||||
|
m_MirrorParameter:
|
||||||
|
m_CycleOffsetParameter:
|
||||||
|
m_TimeParameter:
|
||||||
|
--- !u!1102 &4761740218506164828
|
||||||
|
AnimatorState:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: playerAttack
|
||||||
|
m_Speed: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_Transitions:
|
||||||
|
- {fileID: 7527007860389132503}
|
||||||
|
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: 4963fd28dae460640a761546b7b5c596, type: 2}
|
||||||
|
m_Tag:
|
||||||
|
m_SpeedParameter:
|
||||||
|
m_MirrorParameter:
|
||||||
|
m_CycleOffsetParameter:
|
||||||
|
m_TimeParameter:
|
||||||
|
--- !u!1101 &7527007860389132503
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions: []
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 2731809886444445990}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 1
|
||||||
|
m_HasExitTime: 1
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 1
|
||||||
|
--- !u!1102 &8428018393159066403
|
||||||
|
AnimatorState:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: jump/fall
|
||||||
|
m_Speed: 1
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_Transitions:
|
||||||
|
- {fileID: 563274122570338863}
|
||||||
|
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: -7108901356451733881}
|
||||||
m_Tag:
|
m_Tag:
|
||||||
m_SpeedParameter:
|
m_SpeedParameter:
|
||||||
m_MirrorParameter:
|
m_MirrorParameter:
|
||||||
|
|||||||
123
Assets/Animations/playerAttack.anim
Normal file
123
Assets/Animations/playerAttack.anim
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
%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: playerAttack
|
||||||
|
serializedVersion: 7
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves: []
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves: []
|
||||||
|
m_PPtrCurves:
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
- time: 0
|
||||||
|
value: {fileID: -1059185708, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.06666667
|
||||||
|
value: {fileID: 558846297, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.13333334
|
||||||
|
value: {fileID: 752029924, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.2
|
||||||
|
value: {fileID: 184008166, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.26666668
|
||||||
|
value: {fileID: 820566783, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.33333334
|
||||||
|
value: {fileID: 590827802, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.4
|
||||||
|
value: {fileID: -1161772646, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.46666667
|
||||||
|
value: {fileID: 180173413, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.53333336
|
||||||
|
value: {fileID: 32573988, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.6
|
||||||
|
value: {fileID: 820566783, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.6666667
|
||||||
|
value: {fileID: 184008166, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
attribute: m_Sprite
|
||||||
|
path:
|
||||||
|
classID: 212
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 2
|
||||||
|
m_SampleRate: 15
|
||||||
|
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: 0
|
||||||
|
attribute: 0
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 212
|
||||||
|
customType: 23
|
||||||
|
isPPtrCurve: 1
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
pptrCurveMapping:
|
||||||
|
- {fileID: -1059185708, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 558846297, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 752029924, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 184008166, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 820566783, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 590827802, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: -1161772646, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 180173413, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 32573988, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 820566783, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 184008166, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 0.73333335
|
||||||
|
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: []
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 0
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events:
|
||||||
|
- time: 0
|
||||||
|
functionName: DisableMovementAndJump
|
||||||
|
data:
|
||||||
|
objectReferenceParameter: {fileID: 0}
|
||||||
|
floatParameter: 0
|
||||||
|
intParameter: 0
|
||||||
|
messageOptions: 0
|
||||||
|
- time: 0.33333334
|
||||||
|
functionName: DamageEnemies
|
||||||
|
data:
|
||||||
|
objectReferenceParameter: {fileID: 0}
|
||||||
|
floatParameter: 0
|
||||||
|
intParameter: 0
|
||||||
|
messageOptions: 0
|
||||||
|
- time: 0.6666667
|
||||||
|
functionName: EnableMovementAndJump
|
||||||
|
data:
|
||||||
|
objectReferenceParameter: {fileID: 0}
|
||||||
|
floatParameter: 0
|
||||||
|
intParameter: 0
|
||||||
|
messageOptions: 0
|
||||||
8
Assets/Animations/playerAttack.anim.meta
Normal file
8
Assets/Animations/playerAttack.anim.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4963fd28dae460640a761546b7b5c596
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 7400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
78
Assets/Animations/playerFall.anim
Normal file
78
Assets/Animations/playerFall.anim
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
%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: playerFall
|
||||||
|
serializedVersion: 7
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves: []
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves: []
|
||||||
|
m_PPtrCurves:
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
- time: 0
|
||||||
|
value: {fileID: -270005676, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.083333336
|
||||||
|
value: {fileID: -963690940, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.16666667
|
||||||
|
value: {fileID: -1648917730, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
attribute: m_Sprite
|
||||||
|
path:
|
||||||
|
classID: 212
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 2
|
||||||
|
m_SampleRate: 12
|
||||||
|
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: 0
|
||||||
|
attribute: 0
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 212
|
||||||
|
customType: 23
|
||||||
|
isPPtrCurve: 1
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
pptrCurveMapping:
|
||||||
|
- {fileID: -270005676, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: -963690940, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: -1648917730, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 0.25
|
||||||
|
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: []
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 0
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events: []
|
||||||
8
Assets/Animations/playerFall.anim.meta
Normal file
8
Assets/Animations/playerFall.anim.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 122b1fcaba4d2944e908c03459129cbf
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 7400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
78
Assets/Animations/playerJump.anim
Normal file
78
Assets/Animations/playerJump.anim
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
%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: playerJump
|
||||||
|
serializedVersion: 7
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves: []
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves: []
|
||||||
|
m_PPtrCurves:
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
- time: 0
|
||||||
|
value: {fileID: 1486326522, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.083333336
|
||||||
|
value: {fileID: 284068559, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- time: 0.16666667
|
||||||
|
value: {fileID: 2143798682, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
attribute: m_Sprite
|
||||||
|
path:
|
||||||
|
classID: 212
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 2
|
||||||
|
m_SampleRate: 12
|
||||||
|
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: 0
|
||||||
|
attribute: 0
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 212
|
||||||
|
customType: 23
|
||||||
|
isPPtrCurve: 1
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
pptrCurveMapping:
|
||||||
|
- {fileID: 1486326522, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 284068559, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
- {fileID: 2143798682, guid: 2a192e342a6409b4d9677ef04a238b79, type: 3}
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 0.25
|
||||||
|
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: []
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 0
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events: []
|
||||||
8
Assets/Animations/playerJump.anim.meta
Normal file
8
Assets/Animations/playerJump.anim.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d11062b0858b3c64cb6c4406048bbd03
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 7400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
42
Assets/Enemy.cs
Normal file
42
Assets/Enemy.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Enemy : MonoBehaviour
|
||||||
|
{
|
||||||
|
private SpriteRenderer sr;
|
||||||
|
[SerializeField]private float redColorDuration = 1;
|
||||||
|
public float currentTimeInGame;
|
||||||
|
public float lastTimeWasDamaged;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
sr = GetComponent<SpriteRenderer>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
ChanceColorIfNeedes();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChanceColorIfNeedes()
|
||||||
|
{
|
||||||
|
currentTimeInGame = Time.time;
|
||||||
|
if (currentTimeInGame > lastTimeWasDamaged + redColorDuration)
|
||||||
|
{
|
||||||
|
if (sr.color != Color.white)
|
||||||
|
{
|
||||||
|
TurnWhite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TakeDamage()
|
||||||
|
{
|
||||||
|
sr.color = Color.red;
|
||||||
|
lastTimeWasDamaged = Time.time;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TurnWhite()
|
||||||
|
{
|
||||||
|
sr.color = Color.white;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Enemy.cs.meta
Normal file
2
Assets/Enemy.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 59e2d11d5851d78438d59f16c215baf0
|
||||||
8
Assets/Materials.meta
Normal file
8
Assets/Materials.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7937e918b2888f340887cadf1433afde
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
14
Assets/Materials/Slippy_Material.physicsMaterial2D
Normal file
14
Assets/Materials/Slippy_Material.physicsMaterial2D
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!62 &6200000
|
||||||
|
PhysicsMaterial2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Slippy_Material
|
||||||
|
serializedVersion: 2
|
||||||
|
friction: 0
|
||||||
|
bounciness: 0
|
||||||
|
m_FrictionCombine: 1
|
||||||
|
m_BounceCombine: 4
|
||||||
8
Assets/Materials/Slippy_Material.physicsMaterial2D.meta
Normal file
8
Assets/Materials/Slippy_Material.physicsMaterial2D.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 743a4a351990cf740a3bfa0f9028536e
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 6200000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -5,11 +5,20 @@ public class Player : MonoBehaviour
|
|||||||
private Animator anim;
|
private Animator anim;
|
||||||
private Rigidbody2D rb;
|
private Rigidbody2D rb;
|
||||||
|
|
||||||
|
|
||||||
|
[Header("Attack details")]
|
||||||
|
[SerializeField] private float attackRadius;
|
||||||
|
[SerializeField] private Transform attackPoint;
|
||||||
|
[SerializeField] private LayerMask whatIsEnemy;
|
||||||
|
|
||||||
|
|
||||||
[Header("Movement details")]
|
[Header("Movement details")]
|
||||||
[SerializeField] private float moveSpeed = 4.58f;
|
[SerializeField] private float moveSpeed = 8f;
|
||||||
[SerializeField] private float jumpForce = 12;
|
[SerializeField] private float jumpForce = 12;
|
||||||
private bool facingRight = true;
|
private bool facingRight = true;
|
||||||
private float xInput;
|
private float xInput;
|
||||||
|
private bool canMove = true;
|
||||||
|
private bool canJump = true;
|
||||||
|
|
||||||
[Header("Collision details")]
|
[Header("Collision details")]
|
||||||
[SerializeField] private float groundCheckDistance;
|
[SerializeField] private float groundCheckDistance;
|
||||||
@@ -32,31 +41,66 @@ public class Player : MonoBehaviour
|
|||||||
HandleFlip();
|
HandleFlip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DamageEnemies()
|
||||||
|
{
|
||||||
|
Collider2D[] enemyColliders = Physics2D.OverlapCircleAll(attackPoint.position, attackRadius, whatIsEnemy);
|
||||||
|
foreach (Collider2D enemy in enemyColliders)
|
||||||
|
{
|
||||||
|
enemy.GetComponent<Enemy>().TakeDamage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EnableMovementAndJump(bool enable)
|
||||||
|
{
|
||||||
|
canMove = enable;
|
||||||
|
canJump = enable;
|
||||||
|
}
|
||||||
|
|
||||||
private void HandleInput()
|
private void HandleInput()
|
||||||
{
|
{
|
||||||
xInput = Input.GetAxisRaw("Horizontal");
|
xInput = Input.GetAxisRaw("Horizontal");
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.K))
|
if (Input.GetKeyDown(KeyCode.K))
|
||||||
{
|
{
|
||||||
jump();
|
TryToJump();
|
||||||
|
}
|
||||||
|
if (Input.GetKeyDown(KeyCode.J))
|
||||||
|
{
|
||||||
|
TryToAttack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void TryToAttack()
|
||||||
|
{
|
||||||
|
if(isGrounded && canMove)
|
||||||
|
{
|
||||||
|
anim.SetTrigger("attack");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void HandleAnimations()
|
private void HandleAnimations()
|
||||||
{
|
{
|
||||||
bool isMoving = rb.linearVelocity.x != 0;
|
anim.SetFloat("xVelocity", rb.linearVelocity.x);
|
||||||
anim.SetBool("isMoving", isMoving);
|
anim.SetFloat("yVelocity", rb.linearVelocity.y);
|
||||||
|
anim.SetBool("isGrounded", isGrounded);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleMovement()
|
private void HandleMovement()
|
||||||
{
|
{
|
||||||
rb.linearVelocity = new Vector2(xInput * moveSpeed, rb.linearVelocity.y);
|
if(canMove)
|
||||||
|
{
|
||||||
|
rb.linearVelocity = new Vector2(xInput * moveSpeed, rb.linearVelocity.y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rb.linearVelocity = new Vector2(0, rb.linearVelocity.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void jump()
|
private void TryToJump()
|
||||||
{
|
{
|
||||||
if (isGrounded)
|
if (isGrounded && canJump)
|
||||||
{
|
{
|
||||||
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
|
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
|
||||||
}
|
}
|
||||||
@@ -69,7 +113,7 @@ public class Player : MonoBehaviour
|
|||||||
|
|
||||||
private void HandleFlip()
|
private void HandleFlip()
|
||||||
{
|
{
|
||||||
if(rb.linearVelocity.x > 0 && facingRight == false)
|
if (rb.linearVelocity.x > 0 && facingRight == false)
|
||||||
{
|
{
|
||||||
Flip();
|
Flip();
|
||||||
}
|
}
|
||||||
@@ -88,6 +132,7 @@ public class Player : MonoBehaviour
|
|||||||
private void OnDrawGizmos()
|
private void OnDrawGizmos()
|
||||||
{
|
{
|
||||||
Gizmos.DrawLine(transform.position, transform.position + new Vector3(0, -groundCheckDistance));
|
Gizmos.DrawLine(transform.position, transform.position + new Vector3(0, -groundCheckDistance));
|
||||||
|
Gizmos.DrawWireSphere(attackPoint.position, attackRadius);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
15
Assets/PlayerAnimationEvents.cs
Normal file
15
Assets/PlayerAnimationEvents.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class PlayAnimationEvents : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Player player;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
player = GetComponentInParent<Player>();
|
||||||
|
}
|
||||||
|
public void DamageEnemies() => player.DamageEnemies();
|
||||||
|
private void DisableMovementAndJump() => player.EnableMovementAndJump(false);
|
||||||
|
private void EnableMovementAndJump() => player.EnableMovementAndJump(true);
|
||||||
|
|
||||||
|
}
|
||||||
2
Assets/PlayerAnimationEvents.cs.meta
Normal file
2
Assets/PlayerAnimationEvents.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2babfd50ef367814a809844b3888ac22
|
||||||
@@ -119,6 +119,37 @@ NavMeshSettings:
|
|||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &155500594
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 155500595}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: AttackPoint
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &155500595
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 155500594}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 1.32, y: -0.06, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 420449211}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &420449208
|
--- !u!1 &420449208
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -174,11 +205,12 @@ Transform:
|
|||||||
m_GameObject: {fileID: 420449208}
|
m_GameObject: {fileID: 420449208}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 4.01, y: -1.26, z: 0}
|
m_LocalPosition: {x: 3.88, y: -1.63, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1414990379}
|
- {fileID: 1414990379}
|
||||||
|
- {fileID: 155500595}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &420449213
|
--- !u!114 &420449213
|
||||||
@@ -193,6 +225,11 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: cb2ed43676cd08e4da098563b4cef1e9, type: 3}
|
m_Script: {fileID: 11500000, guid: cb2ed43676cd08e4da098563b4cef1e9, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::Player
|
m_EditorClassIdentifier: Assembly-CSharp::Player
|
||||||
|
attackRadius: 0.97
|
||||||
|
attackPoint: {fileID: 155500595}
|
||||||
|
whatIsEnemy:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 128
|
||||||
moveSpeed: 8
|
moveSpeed: 8
|
||||||
jumpForce: 12
|
jumpForce: 12
|
||||||
groundCheckDistance: 1.4
|
groundCheckDistance: 1.4
|
||||||
@@ -209,7 +246,7 @@ CapsuleCollider2D:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Density: 1
|
m_Density: 1
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 6200000, guid: 743a4a351990cf740a3bfa0f9028536e, type: 2}
|
||||||
m_IncludeLayers:
|
m_IncludeLayers:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 0
|
m_Bits: 0
|
||||||
@@ -323,7 +360,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 454696404}
|
m_GameObject: {fileID: 454696404}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -0.14, y: -3.14, z: 0}
|
m_LocalPosition: {x: 0.34, y: -3.62, z: 0}
|
||||||
m_LocalScale: {x: 16.002186, y: 1, z: 1}
|
m_LocalScale: {x: 16.002186, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
@@ -623,6 +660,157 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &915961694
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 915961698}
|
||||||
|
- component: {fileID: 915961697}
|
||||||
|
- component: {fileID: 915961696}
|
||||||
|
- component: {fileID: 915961695}
|
||||||
|
m_Layer: 7
|
||||||
|
m_Name: Enemy
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!61 &915961695
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 915961694}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_ForceSendLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ForceReceiveLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ContactCaptureLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_CallbackLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_CompositeOperation: 0
|
||||||
|
m_CompositeOrder: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
oldSize: {x: 1, y: 1}
|
||||||
|
newSize: {x: 1, y: 1}
|
||||||
|
adaptiveTilingThreshold: 0.5
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &915961696
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 915961694}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 59e2d11d5851d78438d59f16c215baf0, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: '::'
|
||||||
|
--- !u!212 &915961697
|
||||||
|
SpriteRenderer:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 915961694}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!4 &915961698
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 915961694}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -6.06, y: -1.85, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1414990378
|
--- !u!1 &1414990378
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -634,6 +822,7 @@ GameObject:
|
|||||||
- component: {fileID: 1414990379}
|
- component: {fileID: 1414990379}
|
||||||
- component: {fileID: 1414990380}
|
- component: {fileID: 1414990380}
|
||||||
- component: {fileID: 1414990381}
|
- component: {fileID: 1414990381}
|
||||||
|
- component: {fileID: 1414990382}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Animator
|
m_Name: Animator
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -737,6 +926,18 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
|
--- !u!114 &1414990382
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1414990378}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 2babfd50ef367814a809844b3888ac22, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: '::'
|
||||||
--- !u!1660057539 &9223372036854775807
|
--- !u!1660057539 &9223372036854775807
|
||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -745,3 +946,4 @@ SceneRoots:
|
|||||||
- {fileID: 619394802}
|
- {fileID: 619394802}
|
||||||
- {fileID: 454696406}
|
- {fileID: 454696406}
|
||||||
- {fileID: 420449211}
|
- {fileID: 420449211}
|
||||||
|
- {fileID: 915961698}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ TagManager:
|
|||||||
- Water
|
- Water
|
||||||
- UI
|
- UI
|
||||||
- Ground
|
- Ground
|
||||||
-
|
- Enemy
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
|||||||
1022
StudyNotes.md
1022
StudyNotes.md
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user