From 376bbcdc9e1971c98cf0ca3ed3206ed4015145ae Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Mon, 18 Dec 2023 20:49:58 -0500 Subject: [PATCH] explodes :angel: --- Assets/Resources/Games/meatGrinder.prefab | 10 +++--- .../Animations/Meat/MeatAnim.controller | 31 +------------------ Assets/Scripts/Games/MeatGrinder/Meat.cs | 14 +++++++-- 3 files changed, 18 insertions(+), 37 deletions(-) diff --git a/Assets/Resources/Games/meatGrinder.prefab b/Assets/Resources/Games/meatGrinder.prefab index f4a19b986..a06d0334b 100644 --- a/Assets/Resources/Games/meatGrinder.prefab +++ b/Assets/Resources/Games/meatGrinder.prefab @@ -136,7 +136,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 151360738741628551} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -1.23, z: 0} + m_LocalPosition: {x: -19.8, y: -1.2, z: 0} m_LocalScale: {x: 0.6415348, y: 0.6415348, z: 0.6415348} m_ConstrainProportionsScale: 0 m_Children: [] @@ -184,15 +184,15 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 25 - m_Sprite: {fileID: 0} + m_Sprite: {fileID: -4224877059003839859, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 - m_Size: {x: 6.92, y: 1.8} + m_Size: {x: 4.947496, y: 1.9589579} m_AdaptiveModeThreshold: 0.5 m_SpriteTileMode: 0 - m_WasSpriteAssigned: 0 + m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 --- !u!114 &409730438988014783 @@ -221,7 +221,7 @@ Animator: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 151360738741628551} - m_Enabled: 1 + m_Enabled: 0 m_Avatar: {fileID: 0} m_Controller: {fileID: 9100000, guid: a9399fbaa9737da46a5b5358c304c50d, type: 2} m_CullingMode: 0 diff --git a/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Meat/MeatAnim.controller b/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Meat/MeatAnim.controller index 4d80b373c..271a00483 100644 --- a/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Meat/MeatAnim.controller +++ b/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Meat/MeatAnim.controller @@ -1,31 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1102 &-3570823828933063337 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: MeatThrown - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: [] - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 0 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 2f1859638009cff48a2f8c9a3bcdb826, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: --- !u!1102 &-2729320037363072411 AnimatorState: serializedVersion: 6 @@ -92,9 +66,6 @@ AnimatorStateMachine: - serializedVersion: 1 m_State: {fileID: -2729320037363072411} m_Position: {x: 320, y: 240, z: 0} - - serializedVersion: 1 - m_State: {fileID: -3570823828933063337} - m_Position: {x: 440, y: 180, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -125,7 +96,7 @@ AnimatorState: m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 29b550105d0cd9c4fa47fb4df72fb7cc, type: 2} + m_Motion: {fileID: 0} m_Tag: m_SpeedParameter: m_MirrorParameter: diff --git a/Assets/Scripts/Games/MeatGrinder/Meat.cs b/Assets/Scripts/Games/MeatGrinder/Meat.cs index 7d9fee53a..ddd4bf4fd 100644 --- a/Assets/Scripts/Games/MeatGrinder/Meat.cs +++ b/Assets/Scripts/Games/MeatGrinder/Meat.cs @@ -15,6 +15,9 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder private string meatTypeStr; private bool isHit = false; + // const float meatStart = 0; + // const float meatEnd = 3.43f; + [Header("Animators")] private Animator anim; private SpriteRenderer sr; @@ -34,6 +37,7 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder game = MeatGrinder.instance; anim = GetComponent(); sr = GetComponent(); + anim.writeDefaultValuesOnDisable = false; } private void Start() @@ -53,13 +57,18 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder // } Debug.Log(sr.sprite.name); if (!isHit) { - float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, 1.1); - anim.DoNormalizedAnimation("MeatThrown", normalizedBeat); + float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, 1); + float newX = Mathf.LerpUnclamped(-14f, 1.7f, normalizedBeat); + Debug.Log(newX); + transform.position = new Vector3(newX, -1.2f); + + // anim.DoNormalizedAnimation("MeatThrown", normalizedBeat); } } private void Hit(PlayerActionEvent caller, float state) { + anim.enabled = true; isHit = true; game.TackAnim.SetBool("tackMeated", false); anim.DoScaledAnimationAsync(meatTypeStr + "Hit", 0.5f); @@ -73,6 +82,7 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder private void Miss(PlayerActionEvent caller) { + anim.enabled = true; game.bossAnnoyed = true; SoundByte.PlayOneShotGame("meatGrinder/miss");