Ejemplo n.º 1
0
    void Start()
    {
        CircleArea = new GameObject[4];
        //playerHealth = player.GetComponent<PlayerHealth>();

        shark.SetState(0);
        shark.GenerateAggro();

        anim = GetComponent <Animator>();

        if (circleParent == null)
        {
            circleParent = GameObject.FindGameObjectWithTag("CircleArea");
        }

        for (int i = 0; i < CircleArea.Length; i++)
        {
            CircleArea[i] = circleParent.transform.GetChild(i).gameObject;
        }

        if (player == null)
        {
            player = GameObject.FindGameObjectWithTag("Player").transform.GetChild(2).gameObject;
        }

        if (terrain == null)
        {
            terrain = FindObjectOfType <Terrain>();
        }
    }