コード例 #1
0
    //public bool isAttacking = false;

    void OnTriggerEnter(Collider other)
    {
        if (animator.GetBool("IsAttacking") && other.CompareTag("Enemy"))
        {
            FlockAgent otherAgent = other.GetComponent <FlockAgent>();
            if (otherAgent != null)
            {
                otherAgent.Die();
                return;
            }
            RookController rookController = other.GetComponent <RookController>();
            if (rookController != null)
            {
                rookController.Die();
                return;
            }
        }
    }
 public void KillEnemy(FlockAgent prey) //used to kill the given prey (not currently functional)
 {
     prey.Die();                        //Call them to die
 }