예제 #1
0
    void Update()
    {
        if (!friendlyAnimal)         //enemy animal
        {
            animalAI.currentDistance = Vector2.Distance(transform.position, animalAI.playerTransform.transform.position);

            if (idleFallowAtack)
            {
                animalAI.IdleFallowAtack();                 //set how to behave
            }
            else if (walkFallowAtak)
            {
                animalAI.WalkFallowAtak();                 //set how to behave
            }
            if (animalAI.animalAnimator.GetBool("Atack"))
            {
                playerController.isDead = true;
            }
        }
    }