From bcb4396fb5c71487c4b22eac6fd1593fc3049e24 Mon Sep 17 00:00:00 2001 From: Braedon Date: Sat, 5 Feb 2022 15:58:02 -0500 Subject: [PATCH] Was unable to clap more than once at a time --- Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs | 50 ------------------- .../Games/ClappyTrio/ClappyTrioPlayer.cs | 13 ++--- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs index 51895666b..5b3b566a1 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs @@ -30,15 +30,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio instance = this; } - public override void OnGameSwitch() - { - // for (int i = 0; i < Lion.Count; i++) - // { - // SetFace(i, 0); - // } - // PlayAnimationAll("Idle"); - } - private void Start() { float maxWidth = 9.2f; @@ -66,18 +57,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio ClappyTrioPlayer = lion.AddComponent(); } } - - /*LionMiddle = Instantiate(LionLeft, LionLeft.transform.parent); - LionMiddle.transform.localPosition = new Vector3(3.1f, 0); - - LionPlayer = Instantiate(LionLeft, LionLeft.transform.parent); - LionPlayer.transform.localPosition = new Vector3(6.2f, 0); - ClappyTrioPlayer = LionPlayer.AddComponent(); - - - lionHeadLeft = LionLeft.transform.GetChild(1).GetComponent(); - lionHeadMiddle = LionMiddle.transform.GetChild(1).GetComponent(); - lionHeadPlayer = LionPlayer.transform.GetChild(1).GetComponent();*/ } private void Update() @@ -124,35 +103,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio break; } } - - /*if (songPosBeat > lastClapStart && songPosBeat < lastClapStart + 1 && clapIndex == 0) - { - Debug.Log(Conductor.instance.songPositionInBeats); - SetFace(0, 4); - Lion[0].GetComponent().Play("Clap", 0, 0); - Jukebox.PlayOneShotGame("clappyTrio/leftClap"); - - clapIndex++; - } - else if (songPosBeat > lastClapStart + currentClappingLength && songPosBeat < lastClapStart + (currentClappingLength * 2) && clapIndex == 1) - { - Debug.Log(Conductor.instance.songPositionInBeats); - SetFace(1, 4); - Lion[1].GetComponent().Play("Clap", 0, 0); - Jukebox.PlayOneShotGame("clappyTrio/middleClap"); - - clapIndex++; - } - else if (songPosBeat > lastClapStart + (currentClappingLength * 2 - 0.35f) && clapIndex == 2) - { - Debug.Log(Conductor.instance.songPositionInBeats); - ClappyTrioPlayer.SetClapAvailability(lastClapStart + (currentClappingLength * 2 - 0.35f)); - - clapIndex = 0; - isClapping = false; - currentClappingLength = 0; - ClappyTrioPlayer.clapStarted = false; - }*/ } } diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs index 04b93649a..2e0f4479e 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs @@ -12,10 +12,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio private float lastClapLength; [SerializeField] private bool clapVacant; - private int lastIndex; - - private bool hit; - public bool clapStarted = false; public bool canHit; @@ -44,10 +40,9 @@ namespace RhythmHeavenMania.Games.ClappyTrio StateCheck(normalizedBeat); - if (normalizedBeat > Minigame.LateTime()) + if (normalizedBeat > Minigame.EndTime()) { clapVacant = false; - lastIndex = 0; lastClapLength = 0; lastClapBeat = 0; } @@ -66,13 +61,13 @@ namespace RhythmHeavenMania.Games.ClappyTrio lastClapBeat = startBeat; clapVacant = true; lastClapLength = length; + + ResetState(); } private void Clap(bool overrideCanHit) { - bool canHit = state.early != true && state.late != true && state.perfect == true && hit == false; - - if (canHit || overrideCanHit) + if (state.early || state.perfect || overrideCanHit) { clapEffect.SetActive(true); Jukebox.PlayOneShotGame("clappyTrio/rightClap");