fixed order of operation issue

This commit is contained in:
Rapandrasmus 2023-12-26 19:39:32 +01:00
parent fa6efff84f
commit 9de59c357f
2 changed files with 3 additions and 5 deletions

View file

@ -56,7 +56,7 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
for (int i = 0; i < _totems.Count; i++)
{
_totems[i].beat = startBeat + i;
if (_totems[i].beat - 1 >= _game.EndBeat || _game.IsTripleBeat(_totems[i].beat)) _totems[i].transform.gameObject.SetActive(false);
_totems[i].transform.gameObject.SetActive(_totems[i].beat - 1 < _game.EndBeat && !_game.IsTripleBeat(_totems[i].beat));
}
}
@ -79,7 +79,7 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
t.transform.localPosition = new Vector3(t.transform.localPosition.x + (_xDistance * _totemAmount), t.transform.localPosition.y + (_yDistance * _totemAmount));
t.beat += _totemAmount;
t.transform.gameObject.SetActive(!(t.beat - 1 >= _game.EndBeat || _game.IsTripleBeat(t.beat)));
t.transform.gameObject.SetActive(t.beat - 1 < _game.EndBeat && !_game.IsTripleBeat(t.beat));
_totemIndex++;
}
}

View file

@ -98,8 +98,6 @@ namespace HeavenStudio.Games
if (allStarts.Count == 0) return;
_startBeat = allStarts[0].beat;
_totemManager.InitBeats(_startBeat);
BeatAction.New(this, new()
{
new(_startBeat - 1, delegate { _jumper.StartJumping(_startBeat - 1); })
@ -109,7 +107,6 @@ namespace HeavenStudio.Games
if (allStops.Count == 0) return;
_endBeat = allStops[0].beat;
_totemManager.InitBeats(_startBeat);
}
private void HandleBopsOnStart(double beat)
@ -141,6 +138,7 @@ namespace HeavenStudio.Games
}
_tripleEvents = tempTriples;
_totemManager.InitBeats(_startBeat);
}
private void Update()