UnityEngine.NavMeshAgent.SetDestination C# (CSharp) Method

SetDestination() public method

public SetDestination ( Vector3 target ) : bool
target Vector3
return bool
        public bool SetDestination(Vector3 target)
        {
            return INTERNAL_CALL_SetDestination(this, ref target);
        }

Usage Example

コード例 #1
0
ファイル: Clyde.cs プロジェクト: pwestrich/csc_4903_p2
 // Use this for initialization
 void OnEnable()
 {
     agent = GetComponent<NavMeshAgent> ();
     hunting = false;
     huntTimer = 0;
     if (Random.value < 0.5f) {
         currentDestination = Random.Range (0, destinations.Length - 1);
         agent.SetDestination (destinations [currentDestination].transform.position);
     } else {
         hunting = true;
         agent.SetDestination (targetPlayer.transform.position);
         currentDestination = Random.Range (0, destinations.Length - 1);
     }
 }
All Usage Examples Of UnityEngine.NavMeshAgent::SetDestination