mr upbeat input fix + lockstep offbeat switch event seperation (#233)

This commit is contained in:
Rapandrasmus 2023-01-24 20:31:59 +01:00 committed by GitHub
parent d96570513e
commit 7dc9aad090
5 changed files with 24 additions and 57 deletions

View file

@ -25,27 +25,33 @@ namespace HeavenStudio.Games.Loaders
}, },
defaultLength = 1f, defaultLength = 1f,
}, },
new GameAction("hai", "Hai!") new GameAction("marching", "Stepping")
{ {
function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat); }, preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e.length);},
defaultLength = 1f, defaultLength = 4f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat);} resizable = true
}, },
new GameAction("offbeatSwitch", "Switch to Offbeat") new GameAction("offbeatSwitch", "Switch to Offbeat")
{ {
preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OffbeatSwitch(e.beat); }, preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OffbeatSwitch(e.beat); },
defaultLength = 8f defaultLength = 3.5f
}, },
new GameAction("onbeatSwitch", "Switch to Onbeat") new GameAction("onbeatSwitch", "Switch to Onbeat")
{ {
preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OnbeatSwitch(e.beat); }, preFunction = delegate { var e = eventCaller.currentEntity; Lockstep.OnbeatSwitch(e.beat); },
defaultLength = 2f defaultLength = 2f
}, },
new GameAction("marching", "Stepping") new GameAction("hai", "Hai!")
{ {
preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e.length);}, function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Hai(e.beat); },
defaultLength = 4f, defaultLength = 1f,
resizable = true 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") new GameAction("set colours", "Set Background Colours")
{ {
@ -178,6 +184,11 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("lockstep/switch1"); Jukebox.PlayOneShotGame("lockstep/switch1");
} }
public void Ho(float beat)
{
Jukebox.PlayOneShotGame("lockstep/switch4");
}
public static void OnbeatSwitch(float beat) public static void OnbeatSwitch(float beat)
{ {
MultiSound.Play(new MultiSound.Sound[] MultiSound.Play(new MultiSound.Sound[]
@ -207,11 +218,6 @@ namespace HeavenStudio.Games
new MultiSound.Sound("lockstep/switch1", beat + 2f), new MultiSound.Sound("lockstep/switch1", beat + 2f),
new MultiSound.Sound("lockstep/switch2", beat + 3f), new MultiSound.Sound("lockstep/switch2", beat + 3f),
new MultiSound.Sound("lockstep/switch3", beat + 3.5f), 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); }, forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()

View file

@ -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()
{
}
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2fcc6103baa36c048b9f5dfc086bdd98
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -103,6 +103,10 @@ namespace HeavenStudio.Games
} }
queuedInputs.Clear(); queuedInputs.Clear();
} }
if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN))
{
man.Step();
}
} }
} }

View file

@ -23,14 +23,6 @@ namespace HeavenStudio.Games.Scripts_MrUpbeat
public GameEvent blip = new GameEvent(); public GameEvent blip = new GameEvent();
private void Update()
{
if (PlayerInput.Pressed())
{
Step();
}
}
public void Idle() public void Idle()
{ {
stepTimes = 0; stepTimes = 0;