From fb169868b5cad6f712429a80fadb889471aae48d Mon Sep 17 00:00:00 2001 From: Mytiaoga <32819046+Mytiaoga@users.noreply.github.com> Date: Mon, 25 Jul 2022 10:03:01 +0800 Subject: [PATCH] Add files via upload --- .../Scripts/Games/FirstContact/FirstContact.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/Games/FirstContact/FirstContact.cs b/Assets/Scripts/Games/FirstContact/FirstContact.cs index 573d22cd..02e8c820 100644 --- a/Assets/Scripts/Games/FirstContact/FirstContact.cs +++ b/Assets/Scripts/Games/FirstContact/FirstContact.cs @@ -98,7 +98,7 @@ namespace HeavenStudio.Games instance = this; } - public void SetIntervalStart(float beat, float interval = 4f) + public void SetIntervalStart(float beat, float interval) { if (!intervalStarted) { @@ -123,7 +123,7 @@ namespace HeavenStudio.Games lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats); } - if (PlayerInput.Pressed() && !IsExpectingInputNow() && !noHitOnce && !isSpeaking) + if (PlayerInput.Pressed() && !IsExpectingInputNow() && !noHitOnce && !isSpeaking && !missionControl.activeInHierarchy) { Jukebox.PlayOneShotGame("firstContact/" + randomizerLines()); BeatAction.New(this.gameObject, new List() @@ -212,15 +212,7 @@ namespace HeavenStudio.Games public void alienTurnOver(float beat) { - if (!intervalStarted) - { - SetIntervalStart(beat, beatInterval); - } - if (intervalStarted) - { - SetIntervalStart(beat, beatInterval); - } - + SetIntervalStart(beat, beatInterval); Jukebox.PlayOneShotGame("firstContact/turnover"); BeatAction.New(alien, new List() @@ -281,6 +273,7 @@ namespace HeavenStudio.Games alienSpeakCount = 0; translatorSpeakCount = 0; + intervalStarted = false; isSpeaking = false; hasMissed = false; noHitOnce = false; @@ -312,7 +305,7 @@ namespace HeavenStudio.Games { BeatAction.New(missionControl, new List() { - new BeatAction.Action(length, delegate { missionControl.SetActive(false); }), + new BeatAction.Action(beat + length, delegate { missionControl.SetActive(false); }), }); } else