private void Start() { slider = GetComponent <Slider>(); foreach (var checkpoint in checkpoints) { checkpoint.OnCheckpointReady += CheckpointPassed; } currentCheckpoint = checkpoints.First(); }
private void SetNextCheckpoint() { currentCheckpoint.EnableAlert(false); Debug.Log("Current checkpoint id : " + checkpoints.IndexOf(currentCheckpoint)); if (currentCheckpoint != checkpoints.Last()) { currentCheckpoint = checkpoints[checkpoints.IndexOf(currentCheckpoint) + 1]; } else { currentCheckpoint = null; } }