/// <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;
            }
        }
示例#2
0
 private void CheckpointNavigator_onIndexChanged(StratusPositionCheckpoint arg1, int arg2)
 {
     StratusPositionCheckpoint.WarpOnto(arg1, this.transform);
 }
示例#3
0
 private void Start()
 {
     this.checkpointNavigator = StratusPositionCheckpoint.GetNavigator();
     this.checkpointNavigator.onIndexChanged += this.CheckpointNavigator_onIndexChanged;
 }