Пример #1
0
 public void killSelf()
 {
     if (m_damagable)
     {
         m_damagable.killSelf();
     }
 }
Пример #2
0
        public virtual void handleAttack()
        {
            if (explodeOnAttack)
            {
                CameraShake cs = (CameraShake)GameObject.FindObjectOfType(typeof(CameraShake));
                if (cs)
                {
                    cs.shake();
                }
                m_damagable.killSelf();
            }
            if (m_animator)
            {
                m_animator.SetBool("Attack", true);
            }
            if (m_agent && m_agent.isOnNavMesh)
            {
                m_agent.Stop();
            }
            Damagable dam = m_target.GetComponent <Damagable>();

            if (dam)
            {
                dam.damage(attackDamage, Damagable.DamagableType.MELEE);
            }
            m_attackTime = attackTime;
        }