/// <summary> /// Translates the given object onto one of the checkpoints /// </summary> /// <param name="obj"></param> public void TranslateToCheckpoint(Transform target, StratusPositionCheckpoint checkpoint) { Vector3 position = checkpoint.transform.position; var navigation = target.GetComponent <NavMeshAgent>(); if (navigation != null) { navigation.Warp(position); } else { target.position = position; } }
private void CheckpointNavigator_onIndexChanged(StratusPositionCheckpoint arg1, int arg2) { StratusPositionCheckpoint.WarpOnto(arg1, this.transform); }
private void Start() { this.checkpointNavigator = StratusPositionCheckpoint.GetNavigator(); this.checkpointNavigator.onIndexChanged += this.CheckpointNavigator_onIndexChanged; }