Ejemplo n.º 1
0
    public bool hasFoundPosition;   //is executed, when we need to search for the target again

    void Start()
    {
        if (navMeshAgent == null)
        {
            navMeshAgent = gameObject.GetComponent <NavMeshAgent>();
        }
        target = GameObject.FindGameObjectWithTag("Target").transform;

        if (uiManager == null)
        {
            uiManager = GameObject.FindGameObjectWithTag("UIManager").GetComponent <UIManager>();
        }

        if (gameManager == null)
        {
            gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <WorldUpdateHandler>();
        }

        if (alternateTarget == null)
        {
            alternateTarget = GameObject.FindGameObjectWithTag("DummyTarget").transform;
        }

        hasAnimalFoundOwner = false;

        startingPosition = gameObject.transform.position;
    }
Ejemplo n.º 2
0
 void Start()
 {
     posiCount       = 0;
     hasBeenCaught   = false;
     hasOwnerArrived = false;
     gameManager     = GameObject.FindGameObjectWithTag("GameManager").GetComponent <WorldUpdateHandler>();
     gameObject.transform.position = positions[posiCount].transform.position;
     posiLimit = positions.Length;
 }