diff --git a/Assets/Resources/Games/wizardsWaltz.prefab b/Assets/Resources/Games/wizardsWaltz.prefab index 1369c166..7d8147d7 100644 --- a/Assets/Resources/Games/wizardsWaltz.prefab +++ b/Assets/Resources/Games/wizardsWaltz.prefab @@ -204,6 +204,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 5068490343008965940} + - component: {fileID: 6016131923214625071} - component: {fileID: 7265463465499129635} - component: {fileID: 9147818320159898070} m_Layer: 0 @@ -227,6 +228,25 @@ Transform: m_Father: {fileID: 7248900333300803150} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &6016131923214625071 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1194608921018870769} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 58de0406eb0b927408d884b8508a24c6, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!212 &7265463465499129635 SpriteRenderer: m_ObjectHideFlags: 0 @@ -290,6 +310,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9d323f90f8c1dd54da6d53d21013cf5c, type: 3} m_Name: m_EditorClassIdentifier: + animator: {fileID: 6016131923214625071} shadow: {fileID: 1172109260453278802} --- !u!1 &1740010938943195280 GameObject: diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Appear.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantAppear.anim similarity index 99% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Appear.anim rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantAppear.anim index 981dbe64..8d5a837d 100644 --- a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Appear.anim +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantAppear.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Appear + m_Name: PlantAppear serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Appear.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantAppear.anim.meta similarity index 100% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Appear.anim.meta rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantAppear.anim.meta diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Eat.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEat.anim similarity index 99% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Eat.anim rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEat.anim index 087509b3..17ef5ac9 100644 --- a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Eat.anim +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEat.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Eat + m_Name: PlantEat serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Eat.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEat.anim.meta similarity index 100% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Eat.anim.meta rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEat.anim.meta diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/EatLoop.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEatLoop.anim similarity index 98% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/EatLoop.anim rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEatLoop.anim index ef23c5a2..835f1cda 100644 --- a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/EatLoop.anim +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEatLoop.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: EatLoop + m_Name: PlantEatLoop serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/EatLoop.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEatLoop.anim.meta similarity index 100% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/EatLoop.anim.meta rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantEatLoop.anim.meta diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Hit.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantHit.anim similarity index 99% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Hit.anim rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantHit.anim index 9ef48fd4..c22a1089 100644 --- a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Hit.anim +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantHit.anim @@ -6,7 +6,7 @@ AnimationClip: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Hit + m_Name: PlantHit serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Hit.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantHit.anim.meta similarity index 100% rename from Assets/Resources/Sprites/Games/WizardsWaltz/Animations/Hit.anim.meta rename to Assets/Resources/Sprites/Games/WizardsWaltz/Animations/PlantHit.anim.meta diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller new file mode 100644 index 00000000..98d0eab4 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller @@ -0,0 +1,101 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-4718869513436913057 +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: 8515424114401048048} + m_Position: {x: 300, y: 70, z: 0} + - serializedVersion: 1 + m_State: {fileID: 6278702679387289231} + m_Position: {x: 290, 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: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 8515424114401048048} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WizardAnimator + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -4718869513436913057} + 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!1102 &6278702679387289231 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Magic + m_Speed: 0.25 + 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: 93734c9b385564b4faedd93baa9d3252, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &8515424114401048048 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 0.25 + 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: 233ca8cec63c3f8478bd4925bf18ea67, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller.meta new file mode 100644 index 00000000..1671d6a1 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardAnimator.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 58de0406eb0b927408d884b8508a24c6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim new file mode 100644 index 00000000..361e2d29 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim @@ -0,0 +1,68 @@ +%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: WizardIdle + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: 6626715444242248344, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + 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 + pptrCurveMapping: + - {fileID: 6626715444242248344, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.016666668 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + 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/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim.meta new file mode 100644 index 00000000..3f83b144 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardIdle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 233ca8cec63c3f8478bd4925bf18ea67 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim new file mode 100644 index 00000000..e002d168 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim @@ -0,0 +1,77 @@ +%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: WizardMagic + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: -5319955813400714423, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - time: 0.016666668 + value: {fileID: -5456092200958371718, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - time: 0.033333335 + value: {fileID: 3255871077347632709, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - time: 0.05 + value: {fileID: 6626715444242248344, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + 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 + pptrCurveMapping: + - {fileID: -5319955813400714423, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - {fileID: -5456092200958371718, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - {fileID: 3255871077347632709, guid: affa77f4c5206f444a79fbd5d03c0aa4, type: 3} + - {fileID: 6626715444242248344, guid: affa77f4c5206f444a79fbd5d03c0aa4, 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: 0 + 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/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim.meta b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim.meta new file mode 100644 index 00000000..e0559d48 --- /dev/null +++ b/Assets/Resources/Sprites/Games/WizardsWaltz/Animations/WizardMagic.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93734c9b385564b4faedd93baa9d3252 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Games/WizardsWaltz/Wizard.cs b/Assets/Scripts/Games/WizardsWaltz/Wizard.cs index 8ad64706..72e93863 100644 --- a/Assets/Scripts/Games/WizardsWaltz/Wizard.cs +++ b/Assets/Scripts/Games/WizardsWaltz/Wizard.cs @@ -7,6 +7,7 @@ namespace RhythmHeavenMania.Games.WizardsWaltz { public class Wizard : MonoBehaviour { + public Animator animator; public GameObject shadow; private WizardsWaltz game; @@ -34,8 +35,18 @@ namespace RhythmHeavenMania.Games.WizardsWaltz shadow.transform.localScale = new Vector3(scale, scale, 1); } + private void LateUpdate() + { + if (PlayerInput.Pressed(true)) + { + animator.Play("Magic", 0, 0); + } + } + public void Magic(Plant plant, bool hit) { + animator.Play("Magic", 0, 0); + if(plant == null) { // TODO: Play empty A press sound