diff --git a/Assets/Scripts/EventCaller.cs b/Assets/Scripts/EventCaller.cs index 140b31f70..628eb7372 100644 --- a/Assets/Scripts/EventCaller.cs +++ b/Assets/Scripts/EventCaller.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using UnityEngine; using Jukebox; using HeavenStudio.Games; +using HeavenStudio.Util; namespace HeavenStudio { @@ -66,7 +67,7 @@ namespace HeavenStudio Minigames.Init(this); } - public void CallEvent(RiqEntity entity, bool gameActive) + public void CallEvent(RiqEntity entity, bool gameActive, bool preEvent = false) { string[] details = entity.datamodel.Split('/'); Minigames.Minigame game = minigames[details[0]]; @@ -77,14 +78,22 @@ namespace HeavenStudio if (details.Length > 2) currentSwitchGame = details[2]; Minigames.GameAction action = game.actions.Find(c => c.actionName == details[1]); - if (gameActive) + if (preEvent) { - action.function.Invoke(); + action.preFunction.Invoke(); } else { - action.inactiveFunction.Invoke(); + if (gameActive) + { + action.function.Invoke(); + } + else + { + action.inactiveFunction.Invoke(); + } } + } catch (Exception ex) { @@ -92,22 +101,22 @@ namespace HeavenStudio } } - public void CallPreEvent(RiqEntity entity) - { - string[] details = entity.datamodel.Split('/'); - Minigames.Minigame game = minigames[details[0]]; - try - { - currentEntity = entity; + // public void CallPreEvent(RiqEntity entity) + // { + // string[] details = entity.datamodel.Split('/'); + // Minigames.Minigame game = minigames[details[0]]; + // try + // { + // currentEntity = entity; - Minigames.GameAction action = game.actions.Find(c => c.actionName == details[1]); - action.preFunction.Invoke(); - } - catch (Exception ex) - { - Debug.LogWarning("Event not found! May be spelled wrong or it is not implemented.\n" + ex); - } - } + // Minigames.GameAction action = game.actions.Find(c => c.actionName == details[1]); + // action.preFunction.Invoke(); + // } + // catch (Exception ex) + // { + // Debug.LogWarning("Event not found! May be spelled wrong or it is not implemented.\n" + ex); + // } + // } public static List GetAllInGameManagerList(string gameName) { diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index a431eec9a..eba56c66f 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -445,7 +445,8 @@ namespace HeavenStudio foreach (RiqEntity entity in entitiesInRange) { - eventCaller.CallPreEvent(entity); + // no, the second parameter doesn't matter here. i don't know a good way to make it work better, tho + eventCaller.CallEvent(entity, true, true); currentPreSequence++; } } diff --git a/Assets/Scripts/Games/AirRally/AirRally.cs b/Assets/Scripts/Games/AirRally/AirRally.cs index 275fe4ed0..ff01e49bb 100644 --- a/Assets/Scripts/Games/AirRally/AirRally.cs +++ b/Assets/Scripts/Games/AirRally/AirRally.cs @@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Loaders function = delegate { AirRally.instance.SetDistance(e.currentEntity.beat, e.currentEntity["type"], e.currentEntity["ease"]); }, parameters = new List() { - new Param("type", AirRally.DistanceSound.close, "Type", "Set Forthington's distance."), + new Param("type", AirRally.DistanceSound.Close, "Type", "Set Forthington's distance."), new Param("ease", EasingFunction.Ease.EaseOutQuad, "Ease", "Set the easing of the action.") } }, @@ -375,10 +375,11 @@ namespace HeavenStudio.Games instance = this; forthTrans = Forthington.transform; baxterTrans = Baxter.transform; - if (!Conductor.instance.isPlaying) - { - InitClouds(0); - } + // lags the game WAY too much when seeking + // if (!Conductor.instance.isPlaying) + // { + // InitClouds(0); + // } } // Update is called once per frame @@ -743,10 +744,10 @@ namespace HeavenStudio.Games public enum DistanceSound { - close = 0, - far = 1, - farther = 2, - farthest = 3 + Close = 0, + Far = 1, + Farther = 2, + Farthest = 3 } public enum CountSound @@ -817,7 +818,7 @@ namespace HeavenStudio.Games public static void ForthCountIn4(double beat, float length) { float realLength = length / 4; - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new List { new MultiSound.Sound("airRally/en/countIn1" + GetDistanceStringAtBeat(beat, true), beat, 1, 1, false, countInOffsets[0]), new MultiSound.Sound("airRally/en/countIn2" + GetDistanceStringAtBeat(beat + (1 * realLength), true), beat + (1 * realLength), 1, 1, false, countInOffsets[1]), @@ -897,7 +898,7 @@ namespace HeavenStudio.Games public static void ForthCountIn8(double beat, float length) { float realLength = length / 8; - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new List { new MultiSound.Sound("airRally/en/countIn1" + GetDistanceStringAtBeat(beat, true), beat, 1, 1, false, countInOffsets[0]), new MultiSound.Sound("airRally/en/countIn2" + GetDistanceStringAtBeat(beat + (2 * realLength), true), beat + (2 * realLength), 1, 1, false, countInOffsets[1]), @@ -929,48 +930,23 @@ namespace HeavenStudio.Games float offset = countInOffsets[type]; DistanceSound distance = DistanceAtBeat(beat); + string countInType = GetDistanceStringAtBeat(beat); - switch (distance) - { - case DistanceSound.close: - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound($"airRally/en/countIn{type + 1}", beat, 1, 1, false, offset), - }, forcePlay: true); - break; - case DistanceSound.far: - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound($"airRally/en/countIn{type + 1}Far", beat, 1, 1, false, offset), - }, forcePlay: true); - break; - case DistanceSound.farther: - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound($"airRally/en/countIn{type + 1}Farther", beat, 1, 1, false, offset), - }, forcePlay: true); - break; - case DistanceSound.farthest: - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound($"airRally/en/countIn{type + 1}Farthest", beat, 1, 1, false, offset), - }, forcePlay: true); - break; - } + SoundByte.PlayOneShotGame($"airRally/en/countIn{type + 1}" + countInType, beat, 1, 1, false, true, offset); } #endregion public void SetDistance(double beat, int type, int ease) { wayPointStartBeat = beat; - currentEase = (HeavenStudio.Util.EasingFunction.Ease)ease; + currentEase = (Util.EasingFunction.Ease)ease; lastWayPointZForForth = wayPointZForForth; wayPointZForForth = (DistanceSound)type switch { - DistanceSound.close => 3.55f, - DistanceSound.far => 35.16f, - DistanceSound.farther => 105.16f, - DistanceSound.farthest => 255.16f, + DistanceSound.Close => 3.55f, + DistanceSound.Far => 35.16f, + DistanceSound.Farther => 105.16f, + DistanceSound.Farthest => 255.16f, _ => throw new System.NotImplementedException() }; DistanceUpdate(); @@ -979,45 +955,48 @@ namespace HeavenStudio.Games private static DistanceSound DistanceAtBeat(double beat) { var allDistances = EventCaller.GetAllInGameManagerList("airRally", new string[] { "set distance" }).FindAll(x => x.beat <= beat); - if (allDistances.Count == 0) return DistanceSound.close; + if (allDistances.Count == 0) return DistanceSound.Close; return (DistanceSound)allDistances[^1]["type"]; } private static string GetDistanceStringAtBeat(double beat, bool emptyClose = false, bool farFarther = false) { - if (farFarther) - { - return DistanceAtBeat(beat) switch - { - DistanceSound.close => "Close", - DistanceSound.far => "Far", - DistanceSound.farther => "Far", - DistanceSound.farthest => "Farthest", - _ => throw new System.NotImplementedException() - }; - } - else if (emptyClose) - { - return DistanceAtBeat(beat) switch - { - DistanceSound.close => "", - DistanceSound.far => "Far", - DistanceSound.farther => "Farther", - DistanceSound.farthest => "Farthest", - _ => throw new System.NotImplementedException() - }; - } - else - { - return DistanceAtBeat(beat) switch - { - DistanceSound.close => "Close", - DistanceSound.far => "Far", - DistanceSound.farther => "Farther", - DistanceSound.farthest => "Farthest", - _ => throw new System.NotImplementedException() - }; - } + // var distanceAtBeat = DistanceAtBeat(beat); + return DistanceAtBeat(beat).ToString(); + // if (farFarther) + // { + + // return DistanceAtBeat(beat) switch + // { + // DistanceSound.Close => "Close", + // DistanceSound.Far => "Far", + // DistanceSound.Farther => "Far", + // DistanceSound.Farthest => "Farthest", + // _ => throw new System.NotImplementedException() + // }; + // } + // else if (emptyClose) + // { + // return DistanceAtBeat(beat) switch + // { + // DistanceSound.Close => "", + // DistanceSound.Far => "Far", + // DistanceSound.Farther => "Farther", + // DistanceSound.Farthest => "Farthest", + // _ => throw new System.NotImplementedException() + // }; + // } + // else + // { + // return DistanceAtBeat(beat) switch + // { + // DistanceSound.Close => "Close", + // DistanceSound.Far => "Far", + // DistanceSound.Farther => "Farther", + // DistanceSound.Farthest => "Farthest", + // _ => throw new System.NotImplementedException() + // }; + // } } private static bool TryGetLastDistanceEvent(double beat, out RiqEntity distanceEvent) @@ -1259,7 +1238,7 @@ namespace HeavenStudio.Games }) }); - ScheduleInput(beat, 1f, InputAction_FlickPress, RallyOnHit, RallyOnMiss, RallyEmpty); + ScheduleInput(beat, 1f, InputAction_FlickPress, RallyOnHit, RallyOnMiss, null); } private bool IsBaBumBeat(double beat) @@ -1350,7 +1329,7 @@ namespace HeavenStudio.Games }); } - MultiSound.Play(sounds.ToArray()); + MultiSound.Play(sounds); BeatAction.New(this, new List() { @@ -1377,7 +1356,7 @@ namespace HeavenStudio.Games new BeatAction.Action(beat + 4f, delegate { Forthington.DoScaledAnimationAsync("Ready", 0.5f); }), }); - ScheduleInput(beat, 4f, InputAction_FlickPress, LongShotOnHit, RallyOnMiss, RallyEmpty); + ScheduleInput(beat, 4f, InputAction_FlickPress, LongShotOnHit, RallyOnMiss, null); } @@ -1406,14 +1385,7 @@ namespace HeavenStudio.Games ReturnObject(Conductor.instance.songPositionInBeatsAsDouble, caller.startBeat + caller.timer + 1f, false); hasMissed = false; ActiveShuttle.DoHit(DistanceAtBeat(caller.startBeat + caller.timer)); - string distanceString = DistanceAtBeat(caller.startBeat + caller.timer) switch - { - DistanceSound.close => "Close", - DistanceSound.far => "Far", - DistanceSound.farther => "Farther", - DistanceSound.farthest => "Farthest", - _ => throw new System.NotImplementedException() - }; + string distanceString = GetDistanceStringAtBeat(caller.startBeat + caller.timer); SoundByte.PlayOneShotGame("airRally/hitBaxter_" + distanceString); @@ -1446,14 +1418,7 @@ namespace HeavenStudio.Games hasMissed = false; ActiveShuttle.DoHit(DistanceAtBeat(caller.startBeat + caller.timer)); - string distanceString = DistanceAtBeat(caller.startBeat + caller.timer) switch - { - DistanceSound.close => "Close", - DistanceSound.far => "Far", - DistanceSound.farther => "Farther", - DistanceSound.farthest => "Farthest", - _ => throw new System.NotImplementedException() - }; + string distanceString = GetDistanceStringAtBeat(caller.startBeat + caller.timer); if (distanceString == "Close") { @@ -1481,11 +1446,6 @@ namespace HeavenStudio.Games shuttleActive = false; ActiveShuttle = null; } - - public void RallyEmpty(PlayerActionEvent caller) - { - //empty - } } } diff --git a/Assets/Scripts/Games/AirRally/CloudsManager.cs b/Assets/Scripts/Games/AirRally/CloudsManager.cs index 219924899..1fce14395 100644 --- a/Assets/Scripts/Games/AirRally/CloudsManager.cs +++ b/Assets/Scripts/Games/AirRally/CloudsManager.cs @@ -47,29 +47,32 @@ namespace HeavenStudio.Games.Scripts_AirRally } } - Cloud GetAvailableCloud() - { - foreach (Cloud cloud in pool) - { - if (!cloud.isWorking) - { - return cloud; - } - } - return null; - } - - // Update is called once per frame void Update() { + if (pool == null) return; time += Time.deltaTime; if (time - lastTime > cloudRepeatRate) { lastTime = time; - GetAvailableCloud()?.StartCloud(cloudRoot.position, false); + var cloud = GetAvailableCloud(); + if (cloud != null) cloud.StartCloud(cloudRoot.position, false); } } + Cloud GetAvailableCloud() + { + if (pool != null) { + foreach (Cloud cloud in pool) + { + if (!cloud.isWorking) + { + return cloud; + } + } + } + return null; + } + public void SetCloudsPerSecond(int cloudsPerSec) { cloudsPerSecond = cloudsPerSec; diff --git a/Assets/Scripts/Games/AirRally/Shuttlecock.cs b/Assets/Scripts/Games/AirRally/Shuttlecock.cs index 681359cdc..a1935a7b9 100644 --- a/Assets/Scripts/Games/AirRally/Shuttlecock.cs +++ b/Assets/Scripts/Games/AirRally/Shuttlecock.cs @@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_AirRally [NonSerialized] public float flyPos; [NonSerialized] public bool isReturning; [NonSerialized] public bool isTossed = false; - [NonSerialized] public AirRally.DistanceSound currentDist = AirRally.DistanceSound.close; + [NonSerialized] public AirRally.DistanceSound currentDist = AirRally.DistanceSound.Close; AirRally game; private void Awake() @@ -58,7 +58,7 @@ namespace HeavenStudio.Games.Scripts_AirRally { var cond = Conductor.instance; - bool isFartherOrMore = currentDist != AirRally.DistanceSound.close && currentDist != AirRally.DistanceSound.far; + bool isFartherOrMore = currentDist != AirRally.DistanceSound.Close && currentDist != AirRally.DistanceSound.Far; Vector3 lastPos = transform.position; if (!rb.simulated) @@ -122,16 +122,16 @@ namespace HeavenStudio.Games.Scripts_AirRally ParticleSystem.MainModule main = hitEffect.main; switch (distance) { - case AirRally.DistanceSound.close: + case AirRally.DistanceSound.Close: main.startSize = 2f; break; - case AirRally.DistanceSound.far: + case AirRally.DistanceSound.Far: main.startSize = 3f; break; - case AirRally.DistanceSound.farther: + case AirRally.DistanceSound.Farther: main.startSize = 4f; break; - case AirRally.DistanceSound.farthest: + case AirRally.DistanceSound.Farthest: main.startSize = 6f; break; } diff --git a/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs b/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs index 5de8bb752..5564c7617 100644 --- a/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs +++ b/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs @@ -182,7 +182,7 @@ namespace HeavenStudio.Games assistantCanBop = false; string twoSound = "boardMeeting/two"; if (beat % 1 != 0) twoSound = "boardMeeting/twoUra"; - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new List { new MultiSound.Sound("boardMeeting/one", beat), new MultiSound.Sound(twoSound, beat + 0.5f), diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs index 5e356d090..038d568db 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs @@ -215,7 +215,7 @@ namespace HeavenStudio.Games { SetFace(idx, 4); Lion[idx].GetComponent().Play("Clap", 0, 0); })); } } - if (sounds.Count > 0) clapSounds = MultiSound.Play(sounds.ToArray()); + if (sounds.Count > 0) clapSounds = MultiSound.Play(sounds); if (actions.Count > 0) clapAction = BeatAction.New(this, actions); // prepare player input diff --git a/Assets/Scripts/Games/Lockstep/Lockstep.cs b/Assets/Scripts/Games/Lockstep/Lockstep.cs index bcfd2de47..bfae47d5d 100644 --- a/Assets/Scripts/Games/Lockstep/Lockstep.cs +++ b/Assets/Scripts/Games/Lockstep/Lockstep.cs @@ -308,7 +308,7 @@ namespace HeavenStudio.Games public override void OnGameSwitch(double beat) { - QueueSwitchBGs(beat); + QueueSwitches(beat); foreach (var evt in scheduledInputs) { evt.Disable(); @@ -318,30 +318,28 @@ namespace HeavenStudio.Games public override void OnPlay(double beat) { queuedInputs.Clear(); - QueueSwitchBGs(beat); + QueueSwitches(beat); } - private void QueueSwitchBGs(double beat) + private void QueueSwitches(double beat) { - double nextGameSwitchBeat = double.MaxValue; - List allEnds = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).FindAll(x => x.beat > beat); - if (allEnds.Count > 0) - { - nextGameSwitchBeat = allEnds[0].beat; - } + double nextGameSwitchBeat = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).Find(x => x.beat > beat)?.beat ?? double.MaxValue; - var switchEventsOn = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "onbeatSwitch" }); - foreach (var on in switchEventsOn) + foreach (var entity in gameManager.Beatmap.Entities) { - if (on.beat >= nextGameSwitchBeat) continue; - OnbeatSwitch(on.beat, beat, on["visual"]); - } - - var switchEventsOff = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "offbeatSwitch" }); - foreach (var off in switchEventsOff) - { - if (off.beat >= nextGameSwitchBeat) continue; - OffbeatSwitch(off.beat, beat, off["visual"]); + switch (entity.datamodel) + { + case "lockstep/onbeatSwitch": { + if (entity.beat >= nextGameSwitchBeat) continue; + OnbeatSwitch(entity.beat, beat, entity["visual"]); + } break; + case "lockstep/offbeatSwitch": { + if (entity.beat >= nextGameSwitchBeat) continue; + OffbeatSwitch(entity.beat, beat, entity["visual"]); + } break; + + default: continue; + } } } @@ -357,7 +355,6 @@ namespace HeavenStudio.Games EntityPreCheck(Conductor.instance.songPositionInBeatsAsDouble); - masterSprite = masterStepperSprite.sprite; stepswitcherLeft.gameObject.SetActive(lessSteppers); stepswitcherRight.gameObject.SetActive(lessSteppers); @@ -496,12 +493,11 @@ namespace HeavenStudio.Games { if (sound) { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("lockstep/nha1", beat, 1, 1, false, 0), - new MultiSound.Sound("lockstep/nha2", beat + 0.5f, 1, 1, false, 0.01), - new MultiSound.Sound("lockstep/nha1", beat + 1f, 1, 1, false, 0), - new MultiSound.Sound("lockstep/nha2", beat + 1.5f, 1, 1, false, 0.01) + MultiSound.Play(new List { + new MultiSound.Sound("lockstep/nha1", beat, 1, 1, false, 0), + new MultiSound.Sound("lockstep/nha2", beat + 0.5f, 1, 1, false, 0.01), + new MultiSound.Sound("lockstep/nha1", beat + 1f, 1, 1, false, 0), + new MultiSound.Sound("lockstep/nha2", beat + 1.5f, 1, 1, false, 0.01) }, forcePlay: true); } @@ -528,7 +524,7 @@ namespace HeavenStudio.Games var haisActual = haisList.FindAll(x => x.beat < nextOffBeat); - MultiSound.Play(haisActual.ToArray(), true, true); + MultiSound.Play(haisActual, true, true); } } @@ -545,14 +541,14 @@ namespace HeavenStudio.Games new BeatAction.Action(beat + 1.5f, delegate { if (visual) ChangeBeatBackGroundColour(true); + if (!marchRecursing && !ForceStepOnBeat(beat + 2f)) MarchRecursive(beat + 2f); }), - new BeatAction.Action(beat + 1.5f, delegate { if (!marchRecursing && !ForceStepOnBeat(beat + 2f)) MarchRecursive(beat + 2f); }), new BeatAction.Action(beat + 2f, delegate { if (visual) ChangeBeatBackGroundColour(false); }), }; List actions = new(); foreach (var action in allActions) { - if (action.beat >= gameswitchBeat) actions.Add(action); + if (action.beat + 0.5 >= gameswitchBeat) actions.Add(action); } if (actions.Count > 0) BeatAction.New(instance, actions); } @@ -561,8 +557,7 @@ namespace HeavenStudio.Games { if (sound) { - MultiSound.Play(new MultiSound.Sound[] - { + MultiSound.Play(new List { new MultiSound.Sound("lockstep/hai", beat, 1, 1, false, 0.018), new MultiSound.Sound("lockstep/hai", beat + 1f, 1, 1, false, 0.018), new MultiSound.Sound("lockstep/hai", beat + 2f, 1, 1, false, 0.018), @@ -594,7 +589,7 @@ namespace HeavenStudio.Games var hosActual = hos.FindAll(x => x.beat < nextOnBeat); - MultiSound.Play(hosActual.ToArray(), true, true); + MultiSound.Play(hosActual, true, true); } } @@ -603,19 +598,19 @@ namespace HeavenStudio.Games List allActions = new List() { new BeatAction.Action(beat, delegate { if (visual) ChangeBeatBackGroundColour(true); }), - new BeatAction.Action(beat + 1f, delegate { if (visual) ChangeBeatBackGroundColour(false); }), - new BeatAction.Action(beat + 2f, delegate { if (visual) ChangeBeatBackGroundColour(true); }), - new BeatAction.Action(beat + 3f, delegate + new BeatAction.Action(beat + 1, delegate { if (visual) ChangeBeatBackGroundColour(false); }), + new BeatAction.Action(beat + 2, delegate { if (visual) ChangeBeatBackGroundColour(true); }), + new BeatAction.Action(beat + 3, delegate { if (visual) ChangeBeatBackGroundColour(false); + if (!marchRecursing && !ForceStepOnBeat(beat + 3.5)) MarchRecursive(beat + 3.5); }), - new BeatAction.Action(beat + 3f, delegate { if (!marchRecursing && !ForceStepOnBeat(beat + 3.5)) MarchRecursive(beat + 3.5f); }), - new BeatAction.Action(beat + 3.5f, delegate { if (visual) ChangeBeatBackGroundColour(true); }), + new BeatAction.Action(beat + 3.5, delegate { if (visual) ChangeBeatBackGroundColour(true); }), }; List actions = new(); foreach (var action in allActions) { - if (action.beat >= gameswitchBeat) actions.Add(action); + if (action.beat + 0.5 >= gameswitchBeat) actions.Add(action); } if (actions.Count > 0) BeatAction.New(instance, actions); } @@ -661,10 +656,10 @@ namespace HeavenStudio.Games bool offBeat = beat % 1 != 0; if (sound) { - MultiSound.Sound[] sounds = new MultiSound.Sound[amount]; + List sounds = new(amount); for (int i = 0; i < amount; i++) { - sounds[i] = new MultiSound.Sound($"lockstep/" + (offBeat ? "ho" : "hai"), beat + i, 1, 1, false, offBeat ? 0.015 : 0.018); + sounds.Add(new MultiSound.Sound($"lockstep/" + (offBeat ? "ho" : "hai"), beat + i, 1, 1, false, offBeat ? 0.015 : 0.018)); } MultiSound.Play(sounds, true, true); } @@ -705,10 +700,10 @@ namespace HeavenStudio.Games } if (sound) { - MultiSound.Sound[] sounds = new MultiSound.Sound[amount]; + List sounds = new(amount); for (int i = 0; i < amount; i++) { - sounds[i] = new MultiSound.Sound($"lockstep/" + (offBeat ? "ho" : "hai"), beat + i, 1, 1, false, offBeat ? 0.015 : 0.018); + sounds.Add(new MultiSound.Sound($"lockstep/" + (offBeat ? "ho" : "hai"), beat + i, 1, 1, false, offBeat ? 0.015 : 0.018)); } MultiSound.Play(sounds, true, true); } diff --git a/Assets/Scripts/Games/Tambourine/Tambourine.cs b/Assets/Scripts/Games/Tambourine/Tambourine.cs index 74ca0f4ba..0140f2903 100644 --- a/Assets/Scripts/Games/Tambourine/Tambourine.cs +++ b/Assets/Scripts/Games/Tambourine/Tambourine.cs @@ -279,7 +279,7 @@ namespace HeavenStudio.Games } BeatAction.New(this, actions); - MultiSound.Play(sounds.ToArray(), true, true); + MultiSound.Play(sounds, true, true); if (autoPassTurn) { @@ -390,7 +390,7 @@ namespace HeavenStudio.Games if (misses > 0) return; flowerParticles.Play(); SoundByte.PlayOneShotGame($"tambourine/player/turnPass/sweep"); - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new List { new MultiSound.Sound("tambourine/player/turnPass/note1", beat), new MultiSound.Sound("tambourine/player/turnPass/note2", beat + 0.1f),