From 785f1d1ef1c31a442815543688221c9890af673c Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 15 Jul 2025 01:36:00 -0700 Subject: [PATCH] Updated melee attack animator and applied to basic attacks --- Assets/Art/Animations/Bobble.anim | 90 ++--- .../Player/AttackAnimation.controller | 257 +++++++++++++ .../Player/AttackAnimation.controller.meta | 8 + Assets/Art/Animations/Player/Slash1.anim | 81 ++++ Assets/Art/Animations/Player/Slash1.anim.meta | 8 + Assets/Art/Animations/Player/Slash2.anim | 257 +++++++++++++ Assets/Art/Animations/Player/Slash2.anim.meta | 8 + .../Art/Sprites/DefaultCharacter/Slash1.ase | Bin 0 -> 3376 bytes .../Sprites/DefaultCharacter/Slash1.ase.meta | 311 +++++++++++++++ Assets/Scenes/HomeTown.unity | 356 +++++++++++++++++- .../Player/Classes/AttackAnimatorFactory.cs | 75 ---- .../Characters/Player/Classes/ClassBase.cs | 4 +- .../Player/Classes/MeleeFighterClass.cs | 10 +- .../Classes/PlayerAttackAnimatorFactory.cs | 84 +++++ ...ta => PlayerAttackAnimatorFactory.cs.meta} | 0 .../Characters/Player/PlayerMainController.cs | 3 +- .../Runtime/GameManagement/GameManager.cs | 1 + Packages/manifest.json | 1 + Packages/packages-lock.json | 6 +- UserSettings/EditorUserSettings.asset | 2 +- 20 files changed, 1409 insertions(+), 153 deletions(-) create mode 100644 Assets/Art/Animations/Player/AttackAnimation.controller create mode 100644 Assets/Art/Animations/Player/AttackAnimation.controller.meta create mode 100644 Assets/Art/Animations/Player/Slash1.anim create mode 100644 Assets/Art/Animations/Player/Slash1.anim.meta create mode 100644 Assets/Art/Animations/Player/Slash2.anim create mode 100644 Assets/Art/Animations/Player/Slash2.anim.meta create mode 100644 Assets/Art/Sprites/DefaultCharacter/Slash1.ase create mode 100644 Assets/Art/Sprites/DefaultCharacter/Slash1.ase.meta delete mode 100644 Assets/Scripts/Runtime/Characters/Player/Classes/AttackAnimatorFactory.cs create mode 100644 Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs rename Assets/Scripts/Runtime/Characters/Player/Classes/{AttackAnimatorFactory.cs.meta => PlayerAttackAnimatorFactory.cs.meta} (100%) diff --git a/Assets/Art/Animations/Bobble.anim b/Assets/Art/Animations/Bobble.anim index 16317ae..4e86833 100644 --- a/Assets/Art/Animations/Bobble.anim +++ b/Assets/Art/Animations/Bobble.anim @@ -20,7 +20,7 @@ AnimationClip: m_Curve: - serializedVersion: 3 time: 0 - value: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0.87037116, z: 0.7844082} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 @@ -29,25 +29,34 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 0.2 - value: {x: 0, y: 0.015572754, z: 0} + value: {x: 0, y: 0.9021639, z: 0.7844082} inSlope: {x: 0, y: 0.25483456, z: 0} outSlope: {x: 0, y: 0.25483456, 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: 0.38333333 + value: {x: 0, y: 1.1873454, z: 0.7844082} + inSlope: {x: 0, y: 1.9520862, z: 0} + outSlope: {x: 0, y: 1.9520862, 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: 0.41666666 - value: {x: 0, y: 0.10228437, z: 0} - inSlope: {x: 0, y: 0.3947592, z: 0} - outSlope: {x: 0, y: 0.3947592, z: 0} + value: {x: 0, y: 1.2483423, z: 0.7844082} + inSlope: {x: 0, y: 1.6778376, z: 0} + outSlope: {x: 0, y: 1.6778376, 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: 0.5 - value: {x: 0, y: 0.1283131, z: 0} + value: {x: 0, y: 1.3346866, z: 0.7844082} inSlope: {x: 0, y: 0.20761947, z: 0} outSlope: {x: 0, y: 0.20761947, z: 0} tangentMode: 0 @@ -56,16 +65,16 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.42225873, z: 0.33333334} - serializedVersion: 3 time: 0.5833333 - value: {x: 0, y: 0.14025, z: 0} - inSlope: {x: 0, y: 0.083868586, z: 0} - outSlope: {x: 0, y: 0.083868586, z: 0} + value: {x: 0, y: 1.3472093, z: 0.7844082} + inSlope: {x: 0, y: 0.09660107, z: 0} + outSlope: {x: 0, y: 0.09660107, 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: 0.85 - value: {x: 0, y: 0.12987658, z: 0} + value: {x: 0, y: 1.3403444, z: 0.7844082} inSlope: {x: 0, y: -0.11044701, z: 0} outSlope: {x: 0, y: -0.11044701, z: 0} tangentMode: 0 @@ -74,16 +83,16 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 1 - value: {x: 0, y: 0.09029832, z: 0} - inSlope: {x: 0, y: -0.36953446, z: 0} - outSlope: {x: 0, y: -0.36953446, z: 0} + value: {x: 0, y: 1.1896566, z: 0.7844082} + inSlope: {x: 0, y: -1.5732216, z: 0} + outSlope: {x: 0, y: -1.5732216, 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.2166667 - value: {x: 0, y: 0.013672401, z: 0} + value: {x: 0, y: 0.9198463, z: 0.7844082} inSlope: {x: 0, y: -0.23819895, z: 0} outSlope: {x: 0, y: -0.23819895, z: 0} tangentMode: 0 @@ -92,7 +101,7 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 1.3833333 - value: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0.87037116, z: 0.7844082} inSlope: {x: 0, y: 0.006638917, z: 0} outSlope: {x: 0, y: 0.006638917, z: 0} tangentMode: 0 @@ -149,7 +158,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.41666666 + time: 0.2 value: 0 inSlope: 0 outSlope: 0 @@ -158,25 +167,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.5 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.5833333 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1 + time: 0.38333333 value: 0 inSlope: 0 outSlope: 0 @@ -198,7 +189,7 @@ AnimationClip: m_Curve: - serializedVersion: 3 time: 0 - value: 0 + value: 0.87037116 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -207,7 +198,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.2 - value: 0.015572754 + value: 0.9021639 inSlope: 0.25483456 outSlope: 0.25483456 tangentMode: 0 @@ -216,7 +207,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.5 - value: 0.1283131 + value: 1.3346866 inSlope: 0.20761947 outSlope: 0.20761947 tangentMode: 0 @@ -225,7 +216,7 @@ AnimationClip: outWeight: 0.42225873 - serializedVersion: 3 time: 0.85 - value: 0.12987658 + value: 1.3403444 inSlope: -0.11044701 outSlope: -0.11044701 tangentMode: 0 @@ -234,7 +225,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 1.2166667 - value: 0.013672401 + value: 0.9198463 inSlope: -0.23819895 outSlope: -0.23819895 tangentMode: 0 @@ -243,7 +234,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 1.3833333 - value: 0 + value: 0.87037116 inSlope: 0.006638917 outSlope: 0.006638917 tangentMode: 0 @@ -262,18 +253,9 @@ AnimationClip: 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: 0.41666666 - value: 0 + value: 0.7844082 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -282,7 +264,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.5 - value: 0 + value: 0.7844082 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -291,7 +273,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.5833333 - value: 0 + value: 0.7844082 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -300,7 +282,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 1 - value: 0 + value: 0.7844082 inSlope: 0 outSlope: 0 tangentMode: 136 diff --git a/Assets/Art/Animations/Player/AttackAnimation.controller b/Assets/Art/Animations/Player/AttackAnimation.controller new file mode 100644 index 0000000..dfc4a8f --- /dev/null +++ b/Assets/Art/Animations/Player/AttackAnimation.controller @@ -0,0 +1,257 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-8153908065981635151 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Slash1 + 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: 2be3e37f29e4a6848b15663cb3ff83c8, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-7287591005394286135 +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: 5051650293656771557} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1107 &-956128692290981692 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -8153908065981635151} + m_Position: {x: 290, y: 110, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -8153908065981635151} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AttackAnimation + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: Blend + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2313356623010234660} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: New Layer + m_StateMachine: {fileID: -956128692290981692} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1101 &1744850431499835666 +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: 5051650293656771557} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1107 &2313356623010234660 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 5961122163848245705} + m_Position: {x: 380, y: 110, z: 0} + - serializedVersion: 1 + m_State: {fileID: 5051650293656771557} + m_Position: {x: 30, y: 170, z: 0} + - serializedVersion: 1 + m_State: {fileID: 2502833858199228860} + m_Position: {x: 380, y: 160, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 50, y: 70, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 5051650293656771557} +--- !u!1102 &2502833858199228860 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Slash2 + m_Speed: 0.5 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1744850431499835666} + 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: a2c0ca68423d40e428585f43f974cbf5, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &5051650293656771557 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blank + 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: 0} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &5104837376672507423 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlendTree + m_Childs: [] + m_BlendParameter: Blend + m_BlendParameterY: Blend + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!1102 &5961122163848245705 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Slash1 + m_Speed: 0.5 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -7287591005394286135} + 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: 2be3e37f29e4a6848b15663cb3ff83c8, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Art/Animations/Player/AttackAnimation.controller.meta b/Assets/Art/Animations/Player/AttackAnimation.controller.meta new file mode 100644 index 0000000..f33db27 --- /dev/null +++ b/Assets/Art/Animations/Player/AttackAnimation.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19053954f80562a45a8e89efeabea17d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/Animations/Player/Slash1.anim b/Assets/Art/Animations/Player/Slash1.anim new file mode 100644 index 0000000..f4851e1 --- /dev/null +++ b/Assets/Art/Animations/Player/Slash1.anim @@ -0,0 +1,81 @@ +%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: Slash1 + 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: 2084452910934024698, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.016666668 + value: {fileID: -2736451627376223018, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.033333335 + value: {fileID: -893459440294663468, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.05 + value: {fileID: 5053079929507107595, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + flags: 2 + 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: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: + - {fileID: 2084452910934024698, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: -2736451627376223018, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: -893459440294663468, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: 5053079929507107595, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.06666667 + 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: [] diff --git a/Assets/Art/Animations/Player/Slash1.anim.meta b/Assets/Art/Animations/Player/Slash1.anim.meta new file mode 100644 index 0000000..fa86d86 --- /dev/null +++ b/Assets/Art/Animations/Player/Slash1.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2be3e37f29e4a6848b15663cb3ff83c8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/Animations/Player/Slash2.anim b/Assets/Art/Animations/Player/Slash2.anim new file mode 100644 index 0000000..96fcb92 --- /dev/null +++ b/Assets/Art/Animations/Player/Slash2.anim @@ -0,0 +1,257 @@ +%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: Slash2 + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 4.1, y: 4.91, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: + m_ScaleCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 1, y: -1, z: 1} + 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: + m_FloatCurves: [] + m_PPtrCurves: + - serializedVersion: 2 + curve: + - time: 0 + value: {fileID: 2084452910934024698, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.016666668 + value: {fileID: -2736451627376223018, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.033333335 + value: {fileID: -893459440294663468, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - time: 0.05 + value: {fileID: 5053079929507107595, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + flags: 2 + 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: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 3 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: + - {fileID: 2084452910934024698, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: -2736451627376223018, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: -893459440294663468, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + - {fileID: 5053079929507107595, guid: 309d09cd04eabea43bdf7c83eace0ecd, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.06666667 + 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: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 4.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 4.91 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: + 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 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: + classID: 4 + script: {fileID: 0} + flags: 0 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 1 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Art/Animations/Player/Slash2.anim.meta b/Assets/Art/Animations/Player/Slash2.anim.meta new file mode 100644 index 0000000..ba816fb --- /dev/null +++ b/Assets/Art/Animations/Player/Slash2.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2c0ca68423d40e428585f43f974cbf5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/Sprites/DefaultCharacter/Slash1.ase b/Assets/Art/Sprites/DefaultCharacter/Slash1.ase new file mode 100644 index 0000000000000000000000000000000000000000..46c4eba9e19d14a5b6d786759df280d717670bf2 GIT binary patch literal 3376 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 - Player = GetComponentInParent(); - TextPopUp = new FloatingTextSpawner(this.transform); - - } - - public Action OnHit; - private void OnTriggerEnter2D(Collider2D other) { - if (!AllowAttacks) return; - if (!other.CompareTag("EnemyHitBox")) return; - Debug.Log($"Colliding with {other.gameObject.name}"); - TextPopUp.SpawnFloatingText($"Hit", Color.red, 3); - OnHit?.Invoke(other.gameObject); - ApplyKnockBack(other); - } - - private void ApplyKnockBack(Collider2D other) { - Rigidbody2D parentRb = other.transform.root.GetComponent(); - if (parentRb == null) return; - Vector3 mouseWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - Vector2 direction = mouseWorldPos - Player.transform.parent.gameObject.transform.position; - parentRb.AddForce(direction * 10f, ForceMode2D.Impulse); - //KnockbackUtility.ApplyKnockback(this, rb2D, hitDirection, 10f, 0.3f); - } - - public void AllowAttack(int allow) { - AllowAttacks = (allow == 1); - } - - public void RotateTowardsMouse() { - Vector3 mouseWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - Vector2 direction = mouseWorldPos - Player.transform.position; - float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg; - transform.rotation = Quaternion.Euler(0, 0, angle - 180f); - } - - public void MeleeResetKineticCharge() { - //Melee.CrossFade("Blank", 0, 1); - } - - public void MeleeBasic(int set) { - return; - RotateTowardsMouse(); - - if (set == 1) Melee.CrossFade("BasicAttack1", 0, 0); - else if (set == 2) Melee.CrossFade("BasicAttack2", 0, 0); - else if (set == 3) Melee.CrossFade("BasicAttack3", 0, 0); - - if (set == 1) Melee.CrossFade("KineticSurge1", 0, 1); - else if (set == 2) Melee.CrossFade("KineticSurge2", 0, 1); - else if (set == 3) Melee.CrossFade("KineticSurge3", 0, 1); - } - - public void MeleeKineticSurge() { - return; - Melee.CrossFade("KineticSurgeRelease", 0, 0); - } -} diff --git a/Assets/Scripts/Runtime/Characters/Player/Classes/ClassBase.cs b/Assets/Scripts/Runtime/Characters/Player/Classes/ClassBase.cs index 804d4d6..daaf52c 100644 --- a/Assets/Scripts/Runtime/Characters/Player/Classes/ClassBase.cs +++ b/Assets/Scripts/Runtime/Characters/Player/Classes/ClassBase.cs @@ -24,7 +24,7 @@ public class ClassBase { protected Transform PlayerTransform { get { return Player.transform; } } protected Vector2 PlayerPos { get { return PlayerTransform.position; } } protected Animator Animator; - protected AttackAnimatorFactory AttackAnimator; + protected PlayerAttackAnimatorFactory AttackAnimator; protected float PlayerOriginalSpeed; protected FloatingTextSpawner TextPopUp; /// Always in the order of Up, Down, Left, Right @@ -35,7 +35,7 @@ public class ClassBase { public ClassBase(Player player) { Player = player; Animator = Player.Animator; - AttackAnimator = Player.AttackAnimator; + AttackAnimator = PlayerAttackAnimatorFactory.Instance; TextPopUp = new FloatingTextSpawner(player.transform); } diff --git a/Assets/Scripts/Runtime/Characters/Player/Classes/MeleeFighterClass.cs b/Assets/Scripts/Runtime/Characters/Player/Classes/MeleeFighterClass.cs index 592d935..fac7ca1 100644 --- a/Assets/Scripts/Runtime/Characters/Player/Classes/MeleeFighterClass.cs +++ b/Assets/Scripts/Runtime/Characters/Player/Classes/MeleeFighterClass.cs @@ -211,6 +211,7 @@ public class MeleeFighterClass : ClassBase { LastComboTime = Time.time; RotateTowardsMouse(); + AttackAnimator?.MeleeBasic(CurrentState); switch (CurrentState) { case AttackState.None: @@ -231,20 +232,17 @@ public class MeleeFighterClass : ClassBase { case AttackState.BasicAttack1: AnimationToPlay = "Attack1"; - AttackAnimator?.MeleeBasic(1); - CreateHitBoxOffset(2, 3, 0.1f, 0.1f); + CreateHitBoxOffset(4, 4, 0.1f, 0.1f); break; case AttackState.BasicAttack2: AnimationToPlay = "Attack2"; - AttackAnimator?.MeleeBasic(2); - CreateHitBoxOffset(2, 3, 0.1f, 0.1f); + CreateHitBoxOffset(4, 4, 0.1f, 0.1f); break; case AttackState.BasicAttack3: AnimationToPlay = "Attack1"; - AttackAnimator?.MeleeBasic(3); - CreateHitBoxOffset(2, 3, 0.1f, 0.1f); + CreateHitBoxOffset(4, 4, 0.1f, 0.1f); break; case AttackState.KineticSurgeRelease: diff --git a/Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs b/Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs new file mode 100644 index 0000000..d5ebc8e --- /dev/null +++ b/Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Unity.Mathematics; +using UnityEngine; + + +public class PlayerAttackAnimatorFactory : MonoBehaviour { + public static PlayerAttackAnimatorFactory Instance; + private Player Player; + private bool AllowAttacks; + protected FloatingTextSpawner TextPopUp; + + public Animator MeleeAnimator; + public List MeleeAnimationNames; + public List MeleeAttackState; + private Dictionary MeleeAnimationNameDict; + + public void Awake() { + Instance = this; + Player = GetComponentInParent(); + TextPopUp = new FloatingTextSpawner(this.transform); + + BuildMeleeAnimationClips(); + } + + private void BuildMeleeAnimationClips() { + MeleeAnimationNameDict = new Dictionary(); + for (int i = 0; i < MeleeAttackState.Count; i++) + MeleeAnimationNameDict.Add(MeleeAttackState[i], MeleeAnimationNames[i]); + } + + public Action OnHit; + private void OnTriggerEnter2D(Collider2D other) { + if (!AllowAttacks) return; + if (!other.CompareTag("EnemyHitBox")) return; + Debug.Log($"Colliding with {other.gameObject.name}"); + TextPopUp.SpawnFloatingText($"Hit", Color.red, 3); + OnHit?.Invoke(other.gameObject); + ApplyKnockBack(other); + } + + private void ApplyKnockBack(Collider2D other) { + Rigidbody2D parentRb = other.transform.root.GetComponent(); + if (parentRb == null) return; + Vector3 mouseWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); + Vector2 direction = mouseWorldPos - Player.transform.parent.gameObject.transform.position; + parentRb.AddForce(direction * 10f, ForceMode2D.Impulse); + //KnockbackUtility.ApplyKnockback(this, rb2D, hitDirection, 10f, 0.3f); + } + + public void AllowAttack(int allow) { + AllowAttacks = (allow == 1); + } + + public void RotateTowardsPlayerDirection() { + //float angle = Mathf.Atan2(Player.PrevDirection.y, Player.PrevDirection.x) * Mathf.Rad2Deg; + //angle = (angle + 360f) % 360f; + + //Vector3 mouseWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); + //Vector2 direction = mouseWorldPos - Player.transform.position; + float angle = Mathf.Atan2(Player.PrevDirection.y, Player.PrevDirection.x) * Mathf.Rad2Deg; + transform.rotation = Quaternion.Euler(0, 0, angle); + } + + public void MeleeResetKineticCharge() { + //Melee.CrossFade("Blank", 0, 1); + } + + public void MeleeBasic(MeleeFighterClass.AttackState state) { + Debug.Log(state.ToString()); + if (!MeleeAnimationNameDict.ContainsKey(state)) return; + RotateTowardsPlayerDirection(); + + MeleeAnimator.CrossFade(MeleeAnimationNameDict[state], 0, 0); + } + + public void MeleeKineticSurge() { + return; + MeleeAnimator.CrossFade("KineticSurgeRelease", 0, 0); + } +} diff --git a/Assets/Scripts/Runtime/Characters/Player/Classes/AttackAnimatorFactory.cs.meta b/Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs.meta similarity index 100% rename from Assets/Scripts/Runtime/Characters/Player/Classes/AttackAnimatorFactory.cs.meta rename to Assets/Scripts/Runtime/Characters/Player/Classes/PlayerAttackAnimatorFactory.cs.meta diff --git a/Assets/Scripts/Runtime/Characters/Player/PlayerMainController.cs b/Assets/Scripts/Runtime/Characters/Player/PlayerMainController.cs index 1435320..13d1320 100644 --- a/Assets/Scripts/Runtime/Characters/Player/PlayerMainController.cs +++ b/Assets/Scripts/Runtime/Characters/Player/PlayerMainController.cs @@ -25,7 +25,7 @@ public class Player : MonoBehaviour { [SerializeField] private GameObject[] ClassIndicators; private ClassBase ActiveClass; [SerializeField] private MeleeFighterClass FighterClass; - public AttackAnimatorFactory AttackAnimator; + public PlayerAttackAnimatorFactory AttackAnimator; [Header("Stamina")] [SerializeField] public float StaminaMax = 100; @@ -243,6 +243,7 @@ public class Player : MonoBehaviour { private void UpdateAnimation() { string state = GetAnimationState(MoveDirection); + if (state == "") return; if (state.Last() == '_') state = state.Replace("_", ""); else diff --git a/Assets/Scripts/Runtime/GameManagement/GameManager.cs b/Assets/Scripts/Runtime/GameManagement/GameManager.cs index f9435a1..157c9f1 100644 --- a/Assets/Scripts/Runtime/GameManagement/GameManager.cs +++ b/Assets/Scripts/Runtime/GameManagement/GameManager.cs @@ -7,6 +7,7 @@ using Unity.VisualScripting; using UnityEngine; public class GameManager : MonoBehaviour { + [SerializeField] public float Timescale { set { Time.timeScale = value; } } [SerializeField] private GameObject CrystalRef; public static GameObject Crystal; diff --git a/Packages/manifest.json b/Packages/manifest.json index ab39494..4745e19 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,5 +1,6 @@ { "dependencies": { + "com.unity.2d.aseprite": "1.2.5", "com.unity.cinemachine": "3.1.4", "com.unity.collab-proxy": "2.8.2", "com.unity.feature.2d": "2.0.1", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 138e300..1941b11 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -15,7 +15,7 @@ }, "com.unity.2d.aseprite": { "version": "1.2.5", - "depth": 1, + "depth": 0, "source": "registry", "dependencies": { "com.unity.2d.common": "10.0.0", @@ -28,7 +28,7 @@ }, "com.unity.2d.common": { "version": "10.0.0", - "depth": 2, + "depth": 1, "source": "registry", "dependencies": { "com.unity.burst": "1.8.4", @@ -194,7 +194,7 @@ }, "com.unity.mathematics": { "version": "1.3.2", - "depth": 2, + "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index b704108..ea9e2cc 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -6,7 +6,7 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: GraphicsSettingsInspector_UserSettings: - value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b07a68ffab74f9ee2a3a30300cea1a11320d0beb1a0c25f7060f494b4cdf1b18f3045e38cb5ad8 + value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b56d6cacb72ba5a52a362c3c0ee63201181433fe3e101bf3250b06144ca74c33ea191f058831cb58d5 flags: 0 RecentlyUsedSceneGuid-0: value: 5554570006545b0e590f0d24457a5e444e154a7d752d72687e2a4835bab66039