示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        navMeshAgent = this.GetComponent <NavMeshAgent>();

        if (navMeshAgent.Equals(null))
        {
            Debug.Log("no navmesh");
        }
        else
        {
            SetDestination();
        }
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        navMeshAgent = this.GetComponent <NavMeshAgent>();

        if (navMeshAgent.Equals(null))
        {
            return;
        }
        else
        {
            navMeshAgent.SetDestination(objective.position);
        }
    }