private void SetCurrentCheckpoint(OldCheckpoint checkpoint)
    {
        if (CurrentCheckpoint != null)
        {
            CurrentCheckpoint.gameObject.SetActive(false);
            CurrentCheckpoint.CheckpointActivated -= CheckpointActivated;
        }

        CurrentCheckpoint = checkpoint;
        CurrentCheckpoint.CheckpointActivated += CheckpointActivated;
        Arrow.Target = CurrentCheckpoint.transform;
        CurrentCheckpoint.gameObject.SetActive(true);
    }
示例#2
0
 private void UnitData_Destroyed(UnitData source)
 {
     Animator.SetBool("Dead", true);
     ArenaObj.SetActive(false);
     // Disable the old checkpoint, so it cannot be retracted.
     // If it were to be retracted, then the player could not get back to weary checkpoint.
     // This is why we disable it.
     OldCheckpoint.SetActive(false);
     // Ensure checkpoint is the weary checkpoint!
     CheckpointSaver.Checkpoint = WearyCheckpoint;
     ExpansionMap.SetActive(true);
     PlayerUnitData.Destroyed -= PlayerUnitData_Destroyed;
     enabled = false;
 }