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