Example #1
0
    void Start()
    {
        GameObject timerObject = GameObject.FindGameObjectWithTag("Timer");

        if (timerObject != null)
        {
            timer = timerObject.GetComponent <TimerTillFree>();
        }
        else
        {
            Debug.Log("FoodForBob Can't find TimerObject");
        }
    }
Example #2
0
    void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        Bob    = GameObject.FindGameObjectWithTag("Bob").transform;
        nav    = GetComponent <UnityEngine.AI.NavMeshAgent>();

        GameObject timerObject = GameObject.FindGameObjectWithTag("Timer");

        if (timerObject != null)
        {
            timer = timerObject.GetComponent <TimerTillFree>();
        }
        else
        {
            Debug.Log("ChickenMovement Can't find TimerObject");
        }

        inBobRadius = false;

        anim = transform.GetComponentInChildren <Animator>();
    }