diff --git a/Assets/Scripts/Games/CoinToss/CoinToss.cs b/Assets/Scripts/Games/CoinToss/CoinToss.cs index 70be60da..755f3554 100644 --- a/Assets/Scripts/Games/CoinToss/CoinToss.cs +++ b/Assets/Scripts/Games/CoinToss/CoinToss.cs @@ -74,7 +74,7 @@ namespace HeavenStudio.Games this.audienceReacting = audienceReacting; - coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty); + coin = ScheduleInput(beat, 6f, InputType.DIRECTION_DOWN, CatchSuccess, CatchMiss, CatchEmpty); } public void CatchSuccess(int state) diff --git a/Assets/Scripts/PlayerInput.cs b/Assets/Scripts/PlayerInput.cs index d994289a..187303cf 100644 --- a/Assets/Scripts/PlayerInput.cs +++ b/Assets/Scripts/PlayerInput.cs @@ -28,44 +28,53 @@ namespace HeavenStudio public static bool AltPressed() { - return Input.GetKeyDown(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput; + return Input.GetKeyDown(KeyCode.X) && playerHasControl(); } public static bool AltPressedUp() { - return Input.GetKeyUp(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput; + return Input.GetKeyUp(KeyCode.X) && playerHasControl(); } public static bool AltPressing() { - return Input.GetKey(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput; + return Input.GetKey(KeyCode.X) && playerHasControl(); } public static bool GetAnyDirectionDown() { - return Input.GetKeyDown(KeyCode.UpArrow) + return (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.LeftArrow) - || Input.GetKeyDown(KeyCode.RightArrow); + || Input.GetKeyDown(KeyCode.RightArrow)) && playerHasControl(); } public static bool GetAnyDirectionUp() { - return Input.GetKeyUp(KeyCode.UpArrow) + return (Input.GetKeyUp(KeyCode.UpArrow) || Input.GetKeyUp(KeyCode.DownArrow) || Input.GetKeyUp(KeyCode.LeftArrow) - || Input.GetKeyUp(KeyCode.RightArrow); + || Input.GetKeyUp(KeyCode.RightArrow)) && playerHasControl(); } public static bool GetAnyDirection() { - return Input.GetKey(KeyCode.UpArrow) + return (Input.GetKey(KeyCode.UpArrow) || Input.GetKey(KeyCode.DownArrow) || Input.GetKey(KeyCode.LeftArrow) - || Input.GetKey(KeyCode.RightArrow); + || Input.GetKey(KeyCode.RightArrow)) && playerHasControl(); } + + + // The autoplay isn't activated AND + // The song is actually playing AND + // The GameManager allows you to Input + public static bool playerHasControl() + { + return !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput; + } } } \ No newline at end of file