From 5514609cc9bfd7302ddc69319b6a59df205c033c Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Sat, 30 Dec 2023 14:51:17 -0500 Subject: [PATCH] fixes + particle improvements all that's left is the phone bop and arc/particle adjustments, im pretty sure --- Assets/Resources/Games/meatGrinder.prefab | 44 +++++++++++-------- .../Animations/Tack/Tack.controller | 2 +- Assets/Scripts/Games/MeatGrinder/Meat.cs | 21 +++++---- .../Scripts/Games/MeatGrinder/MeatGrinder.cs | 23 +++++++--- 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/Assets/Resources/Games/meatGrinder.prefab b/Assets/Resources/Games/meatGrinder.prefab index fc09d9071..c0c274f12 100644 --- a/Assets/Resources/Games/meatGrinder.prefab +++ b/Assets/Resources/Games/meatGrinder.prefab @@ -821,7 +821,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 57 + m_SortingOrder: 1500 m_Sprite: {fileID: 654036574, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -2061,7 +2061,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5367660552507315250} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.63, y: -0.6, z: 0} + m_LocalPosition: {x: 2.63, y: -0.77, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -2076,8 +2076,8 @@ ParticleSystem: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5367660552507315250} serializedVersion: 8 - lengthInSec: 0.2 - simulationSpeed: 1 + lengthInSec: 0.1 + simulationSpeed: 1.3 stopAction: 0 cullingMode: 0 ringBufferMode: 0 @@ -2643,7 +2643,7 @@ ParticleSystem: gravityModifier: serializedVersion: 2 minMaxState: 0 - scalar: 5 + scalar: 3.5 minScalar: 0 maxCurve: serializedVersion: 2 @@ -3064,7 +3064,7 @@ ParticleSystem: m_RotationOrder: 4 cycleCount: 1 repeatInterval: 0.01 - probability: 1 + probability: 0 SizeModule: enabled: 1 curve: @@ -3078,21 +3078,21 @@ ParticleSystem: - serializedVersion: 3 time: 0 value: 1 - inSlope: 0 - outSlope: 0 + inSlope: -0.02398534 + outSlope: -0.02398534 tangentMode: 0 weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 + inWeight: 0 + outWeight: 0.67731327 - serializedVersion: 3 - time: 0.50146484 + time: 0.19609144 value: 0 - inSlope: 0.07242867 - outSlope: 0.07242867 + inSlope: -12.338608 + outSlope: -12.338608 tangentMode: 0 weightedMode: 0 - inWeight: 0.24877101 - outWeight: 0.33333334 + inWeight: 0.18219988 + outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 @@ -3462,9 +3462,9 @@ ParticleSystem: fps: 30 frameOverTime: serializedVersion: 2 - minMaxState: 0 + minMaxState: 3 scalar: 0.9999 - minScalar: 0.9999 + minScalar: 0.85888886 maxCurve: serializedVersion: 2 m_Curve: @@ -3578,6 +3578,12 @@ ParticleSystem: - sprite: {fileID: 956318709, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} - sprite: {fileID: 254911747, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} - sprite: {fileID: -1859398730, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: -1267345776, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: -1087476415, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: -153435262, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: 656107612, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: 148945787, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} + - sprite: {fileID: 1900531226, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} flipU: 0 flipV: 0 VelocityModule: @@ -3638,7 +3644,7 @@ ParticleSystem: y: serializedVersion: 2 minMaxState: 0 - scalar: 1.81 + scalar: 0.5 minScalar: 0 maxCurve: serializedVersion: 2 @@ -7299,7 +7305,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 57 + m_SortingOrder: 1500 m_Sprite: {fileID: -782445393, guid: adbc5b443bdc23e469209cc4f602d17d, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 diff --git a/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Tack/Tack.controller b/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Tack/Tack.controller index 8939ef9ab..b369dbc10 100644 --- a/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Tack/Tack.controller +++ b/Assets/Resources/Sprites/Games/MeatGrinder/Animations/Tack/Tack.controller @@ -184,7 +184,7 @@ AnimatorState: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: TackMissBacon + m_Name: TackMissBaconBall m_Speed: 1 m_CycleOffset: 0 m_Transitions: [] diff --git a/Assets/Scripts/Games/MeatGrinder/Meat.cs b/Assets/Scripts/Games/MeatGrinder/Meat.cs index a7748a823..6a1db786b 100644 --- a/Assets/Scripts/Games/MeatGrinder/Meat.cs +++ b/Assets/Scripts/Games/MeatGrinder/Meat.cs @@ -2,6 +2,7 @@ using HeavenStudio.Util; using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace HeavenStudio.Games.Scripts_MeatGrinder @@ -31,7 +32,6 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder private SpriteRenderer sr; [SerializeField] private Sprite[] meats; - public enum MeatType { DarkMeat, @@ -46,7 +46,7 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder game = MeatGrinder.instance; anim = GetComponent(); sr = GetComponent(); - anim.writeDefaultValuesOnDisable = false; + // anim.writeDefaultValuesOnDisable = false; } private void Start() @@ -89,8 +89,6 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder transform.position += (meatType == MeatType.LightMeat ? meatFlyHeightAlt : meatFlyHeight) * yWeight * Vector3.up; // point towards the next position transform.right = transform.position - lastPos; - - // anim.DoNormalizedAnimation("MeatThrown", normalizedBeat); } } @@ -107,10 +105,17 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder SoundByte.PlayOneShotGame("meatGrinder/" + (isBarely ? "tink" : "meatHit")); game.TackAnim.DoScaledAnimationAsync("TackHit" + (isBarely ? "Barely" : "Success"), 0.5f); - // if (meatType == MeatType.BaconBall) { - // game.DoExpressions(0, (int)MeatGrinder.BossExpressions.Scared); - // } - game.MeatSplash.Play(); + + (float rangeStart, float rangeEnd) = meatType switch { // im not good enough at math to figure out how to make this an equation + MeatType.DarkMeat => (0, 0.333f), + MeatType.LightMeat => (0.334f, 0.666f), + MeatType.BaconBall or _ => (0.667f, 1), + }; + var sheetAnim = game.MeatSplash.textureSheetAnimation; + sheetAnim.frameOverTime = new ParticleSystem.MinMaxCurve(rangeStart, rangeEnd); + + int amount = (int)game.MeatSplash.emission.GetBurst(0).count.constant; + game.MeatSplash.Emit(new ParticleSystem.EmitParams(), amount); if (tackReaction.expression > 0) { BeatAction.New(game, new List() { diff --git a/Assets/Scripts/Games/MeatGrinder/MeatGrinder.cs b/Assets/Scripts/Games/MeatGrinder/MeatGrinder.cs index c7391227d..f526c1da6 100644 --- a/Assets/Scripts/Games/MeatGrinder/MeatGrinder.cs +++ b/Assets/Scripts/Games/MeatGrinder/MeatGrinder.cs @@ -173,12 +173,12 @@ namespace HeavenStudio.Games public ParticleSystem MeatSplash; [SerializeField] Transform[] Gears; - [Header("Animators")] public Animator BossAnim; public Animator TackAnim; [SerializeField] Animator CartGuyParentAnim; [SerializeField] Animator CartGuyAnim; + [Header("Variables")] private bool bossBop = true; public bool bossAnnoyed = false; @@ -276,11 +276,22 @@ namespace HeavenStudio.Games CartGuyParentAnim.gameObject.SetActive(cartEase.length != 0); - if (cond.isPlaying && !cond.isPaused) - foreach (Transform gear in Gears) - { - double newZ = Time.deltaTime * currentGearSpeed * 50 * (gear.name == "Big" ? -1 : 1) / cond.pitchedSecPerBeat; - gear.Rotate(new Vector3(0, 0, (float)newZ)); + // Debug.Log("isPlaying : " + cond.isPlaying); + // Debug.Log("isPaused : " + cond.isPaused); + // Debug.Log("NotStopped : " + cond.NotStopped()); + if (cond.isPlaying && !cond.isPaused) { + foreach (Transform gear in Gears) { + double newZ = Time.deltaTime * currentGearSpeed * 50 * (gear.name == "Big" ? -1 : 1) / cond.pitchedSecPerBeat; + gear.Rotate(new Vector3(0, 0, (float)newZ)); + } + } + + if (cond.isPlaying) { + MeatSplash.Play(); + } else if (cond.isPaused) { + MeatSplash.Pause(); + } else { + MeatSplash.Stop(); } }