From 31e8890190a994c94183d9fad5eb2ee5dcd14d6c Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:03:21 +0200 Subject: [PATCH] Rockers can do it too now --- Assets/Scripts/Games/Rockers/Rockers.cs | 59 +++++++++++++++++-------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/Assets/Scripts/Games/Rockers/Rockers.cs b/Assets/Scripts/Games/Rockers/Rockers.cs index 19d634a3..61b30be1 100644 --- a/Assets/Scripts/Games/Rockers/Rockers.cs +++ b/Assets/Scripts/Games/Rockers/Rockers.cs @@ -976,32 +976,53 @@ namespace HeavenStudio.Games { if (crHandlerInstance.queuedEvents.Count > 0) { + List crEvents = crHandlerInstance.queuedEvents; + foreach (var crEvent in crEvents) + { + if (crEvent.tag == "riff") + { + RockersInput riffComp = Instantiate(rockerInputRef, transform); + riffComp.Init(crEvent["gleeClub"], new int[6] { crEvent["1"], crEvent["2"], crEvent["3"], crEvent["4"], crEvent["5"], crEvent["6"] }, beat, length + crEvent.relativeBeat, + (PremadeSamples)crEvent["sample"], crEvent["sampleTones"]); + ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.STANDARD_DOWN, JustMute, MuteMiss, Empty); + } + else if (crEvent.tag == "bend") + { + RockerBendInput bendComp = Instantiate(rockerBendInputRef, transform); + bendComp.Init(crEvent["Pitch"], beat, length + crEvent.relativeBeat); + ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.DIRECTION_UP, JustUnBend, UnBendMiss, Empty); + } + } + crHandlerInstance.queuedEvents.Clear(); BeatAction.New(instance.gameObject, new List() { - new BeatAction.Action(beat + (length / 2), delegate - { - List crEvents = crHandlerInstance.queuedEvents; - - foreach (var crEvent in crEvents) + new BeatAction.Action(beat + length, delegate + { + JJ.UnHold(); + if (crHandlerInstance.queuedEvents.Count > 0) { - if (crEvent.tag == "riff") + List crEvents = crHandlerInstance.queuedEvents; + + foreach (var crEvent in crEvents) { - RockersInput riffComp = Instantiate(rockerInputRef, transform); - riffComp.Init(crEvent["gleeClub"], new int[6] { crEvent["1"], crEvent["2"], crEvent["3"], crEvent["4"], crEvent["5"], crEvent["6"] }, beat, length + crEvent.relativeBeat, - (PremadeSamples)crEvent["sample"], crEvent["sampleTones"]); - ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.STANDARD_DOWN, JustMute, MuteMiss, Empty); - } - else if (crEvent.tag == "bend") - { - RockerBendInput bendComp = Instantiate(rockerBendInputRef, transform); - bendComp.Init(crEvent["Pitch"], beat, length + crEvent.relativeBeat); - ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.DIRECTION_UP, JustUnBend, UnBendMiss, Empty); + if (crEvent.tag == "riff") + { + RockersInput riffComp = Instantiate(rockerInputRef, transform); + riffComp.Init(crEvent["gleeClub"], new int[6] { crEvent["1"], crEvent["2"], crEvent["3"], crEvent["4"], crEvent["5"], crEvent["6"] }, beat, length + crEvent.relativeBeat, + (PremadeSamples)crEvent["sample"], crEvent["sampleTones"]); + ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.STANDARD_DOWN, JustMute, MuteMiss, Empty); + } + else if (crEvent.tag == "bend") + { + RockerBendInput bendComp = Instantiate(rockerBendInputRef, transform); + bendComp.Init(crEvent["Pitch"], beat, length + crEvent.relativeBeat); + ScheduleInput(beat, length + crEvent.relativeBeat + crEvent.length, InputType.DIRECTION_UP, JustUnBend, UnBendMiss, Empty); + } } + crHandlerInstance.queuedEvents.Clear(); } - crHandlerInstance.queuedEvents.Clear(); - }), - new BeatAction.Action(beat + length, delegate { JJ.UnHold(); }) + }) }); if (moveCamera) {