Small fix to roll cue sound logic

This commit is contained in:
Rapandrasmus 2023-06-26 09:51:47 +02:00
parent 6933e47b74
commit 7b9f86832d
2 changed files with 8 additions and 3 deletions

View file

@ -339,8 +339,12 @@ namespace HeavenStudio.Games
if (end.beat <= entity.beat) tempEnds.Add(end);
}
}
tempEnds.Sort((x, y) => x.beat.CompareTo(y.beat));
double lastSwitchBeat = tempEnds[^1].beat;
double lastSwitchBeat = double.MinValue;
if (tempEnds.Count > 0)
{
tempEnds.Sort((x, y) => x.beat.CompareTo(y.beat));
lastSwitchBeat = tempEnds[^1].beat;
}
double countInBeat = double.MinValue;
float countInLength = 0;
FindCountInBeatAndLength(lastSwitchBeat, ref countInBeat, ref countInLength);
@ -400,6 +404,7 @@ namespace HeavenStudio.Games
public static void PlayRollCue(double beat, RiqEntity entity)
{
if (!IsValidRollCue(entity)) return;
Debug.Log("played roll sound");
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("games/nightWalkRvl/highJump1", beat - 1),

View file

@ -65,7 +65,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
{
List<AgbStar> nonEvolvedStars = currentStars.ToList().FindAll(x => x.evoStage == collectiveEvoStage);
List<AgbStar> onScreenStars = nonEvolvedStars.FindAll(x => x.transform.localPosition.x <= 17.77695f && x.transform.localPosition.x >= -17.77695f && x.transform.localPosition.y <= 10 && x.transform.localPosition.y >= -10);
Debug.Log("OnScreen: " + onScreenStars.Count + " nonEvolved: " + nonEvolvedStars.Count);
//Debug.Log("OnScreen: " + onScreenStars.Count + " nonEvolved: " + nonEvolvedStars.Count);
if (onScreenStars.Count > 0)
{
AgbStar randomStar = onScreenStars[UnityEngine.Random.Range(0, onScreenStars.Count)];