void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.CompareTag("Player"))
     {
         brain  = collider.gameObject;
         state1 = Zstate1.berserk;
     }
 }
 public void KillZombie()
 {
     foreach (Rigidbody rdb in rdbs)
     {
         rdb.isKinematic = false;
     }
     anim1.enabled     = false;
     charctrl1.enabled = false;
     state1            = Zstate1.dead;
 }
    void Attack()
    {
        Vector3 dir = brain.transform.position - transform.position;

        transform.rotation = Quaternion.LookRotation(dir, Vector3.up);
        if (dir.magnitude > 2)
        {
            state1 = Zstate1.berserk;
        }
        anim1.SetBool("attack", true);
    }
    void Berserk()
    {
        Vector3 dir = brain.transform.position - transform.position;

        transform.rotation = Quaternion.LookRotation(dir, Vector3.up);
        charctrl1.SimpleMove(transform.forward);
        if (dir.magnitude < 2)
        {
            state1 = Zstate1.attack;
        }
        anim1.SetBool("attack", false);
    }