public void SetCurrentCheckpoint(Checkpoints newCurrentCheckpoint) //Changes current checkpoint when player walks through checkpoint. { if (currentCheckpoint != null) //If there is already a checkpoint { currentCheckpoint.SetIsActivated(false); //Set that checkpoint to false } currentCheckpoint = newCurrentCheckpoint; //Make current checkpoint equal the new checkpoint currentCheckpoint.SetIsActivated(true); //Activate checkpoint }
public void SetCurrentCheckpoint(Checkpoints newCurrentCheckpoint) { if (currentCheckpoint != null) { currentCheckpoint.SetIsActivated(false); } currentCheckpoint = newCurrentCheckpoint; currentCheckpoint.SetIsActivated(true); }