From 7dc9aad090e07920c3c80562b3a9d2d94ef0113b Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Tue, 24 Jan 2023 20:31:59 +0100 Subject: [PATCH] mr upbeat input fix + lockstep offbeat switch event seperation (#233) --- Assets/Scripts/Games/Lockstep/Lockstep.cs | 34 +++++++++++-------- Assets/Scripts/Games/Lockstep/StepSwitcher.cs | 24 ------------- .../Games/Lockstep/StepSwitcher.cs.meta | 11 ------ Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs | 4 +++ Assets/Scripts/Games/MrUpbeat/UpbeatMan.cs | 8 ----- 5 files changed, 24 insertions(+), 57 deletions(-) delete mode 100644 Assets/Scripts/Games/Lockstep/StepSwitcher.cs delete mode 100644 Assets/Scripts/Games/Lockstep/StepSwitcher.cs.meta diff --git a/Assets/Scripts/Games/Lockstep/Lockstep.cs b/Assets/Scripts/Games/Lockstep/Lockstep.cs index 6f0ec9d3..5eea7f81 100644 --- a/Assets/Scripts/Games/Lockstep/Lockstep.cs +++ b/Assets/Scripts/Games/Lockstep/Lockstep.cs @@ -25,27 +25,33 @@ namespace HeavenStudio.Games.Loaders }, defaultLength = 1f, }, - new GameAction("hai", "Hai!") + new GameAction("marching", "Stepping") { - function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat); }, - defaultLength = 1f, - inactiveFunction = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat);} + preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e.length);}, + defaultLength = 4f, + resizable = true }, new GameAction("offbeatSwitch", "Switch to Offbeat") { preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OffbeatSwitch(e.beat); }, - defaultLength = 8f + defaultLength = 3.5f }, new GameAction("onbeatSwitch", "Switch to Onbeat") { preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OnbeatSwitch(e.beat); }, defaultLength = 2f }, - new GameAction("marching", "Stepping") + new GameAction("hai", "Hai!") { - preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e.length);}, - defaultLength = 4f, - resizable = true + function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat); }, + defaultLength = 1f, + inactiveFunction = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat);} + }, + new GameAction("ho", "Ho!") + { + function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Ho(e.beat); }, + defaultLength = 1f, + inactiveFunction = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Ho(e.beat);} }, new GameAction("set colours", "Set Background Colours") { @@ -178,6 +184,11 @@ namespace HeavenStudio.Games Jukebox.PlayOneShotGame("lockstep/switch1"); } + public void Ho(float beat) + { + Jukebox.PlayOneShotGame("lockstep/switch4"); + } + public static void OnbeatSwitch(float beat) { MultiSound.Play(new MultiSound.Sound[] @@ -207,11 +218,6 @@ namespace HeavenStudio.Games new MultiSound.Sound("lockstep/switch1", beat + 2f), new MultiSound.Sound("lockstep/switch2", beat + 3f), new MultiSound.Sound("lockstep/switch3", beat + 3.5f), - - new MultiSound.Sound("lockstep/switch4", beat + 4.5f), - new MultiSound.Sound("lockstep/switch4", beat + 5.5f), - new MultiSound.Sound("lockstep/switch4", beat + 6.5f), - new MultiSound.Sound("lockstep/switch4", beat + 7.5f), }, forcePlay: true); BeatAction.New(instance.gameObject, new List() diff --git a/Assets/Scripts/Games/Lockstep/StepSwitcher.cs b/Assets/Scripts/Games/Lockstep/StepSwitcher.cs deleted file mode 100644 index b3fa6fb2..00000000 --- a/Assets/Scripts/Games/Lockstep/StepSwitcher.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -using HeavenStudio.Util; - -namespace HeavenStudio.Games.Scripts_Lockstep -{ - public class StepSwitcher : PlayerActionObject - { - - // Start is called before the first frame update - void Awake() - { - - } - - // Update is called once per frame - void Update() - { - - } - } -} diff --git a/Assets/Scripts/Games/Lockstep/StepSwitcher.cs.meta b/Assets/Scripts/Games/Lockstep/StepSwitcher.cs.meta deleted file mode 100644 index c9d3c27a..00000000 --- a/Assets/Scripts/Games/Lockstep/StepSwitcher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2fcc6103baa36c048b9f5dfc086bdd98 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs index 75fc5207..87bdcc0d 100644 --- a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs +++ b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs @@ -103,6 +103,10 @@ namespace HeavenStudio.Games } queuedInputs.Clear(); } + if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + { + man.Step(); + } } } diff --git a/Assets/Scripts/Games/MrUpbeat/UpbeatMan.cs b/Assets/Scripts/Games/MrUpbeat/UpbeatMan.cs index 0e482395..44480110 100644 --- a/Assets/Scripts/Games/MrUpbeat/UpbeatMan.cs +++ b/Assets/Scripts/Games/MrUpbeat/UpbeatMan.cs @@ -23,14 +23,6 @@ namespace HeavenStudio.Games.Scripts_MrUpbeat public GameEvent blip = new GameEvent(); - private void Update() - { - if (PlayerInput.Pressed()) - { - Step(); - } - } - public void Idle() { stepTimes = 0;