Beispiel #1
0
 private void Start()
 {
     slider = GetComponent <Slider>();
     foreach (var checkpoint in checkpoints)
     {
         checkpoint.OnCheckpointReady += CheckpointPassed;
     }
     currentCheckpoint = checkpoints.First();
 }
Beispiel #2
0
 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;
     }
 }