public static Checkpoint GetCheckpointFromMinified(MinifiedCheckpoint minCheckpoint) { if (minCheckpoint == null) { return(null); } Checkpoint[] checkpoints = FindObjectsOfType <Checkpoint>(); return(Array.Find(checkpoints, checkpoint => checkpoint.GetId() == minCheckpoint.id)); }
public void SetLastActivatedCheckpoint(string sceneName, MinifiedCheckpoint checkpoint) { foreach (Level level in levels) { if (level.sceneName == sceneName) { level.latestCheckpoint = checkpoint; } } }