Ejemplo n.º 1
0
        virtual protected void OnTriggerEnter(Collider other)
        {
            Damageable oppDamageable = other.GetComponent <Damageable>();

            if (oppDamageable)
            {
                bool touched = oppDamageable.TakeDamage(this, m_currData.damage, m_attackID);
                if (!touched)
                {
                    return;
                }

                if (other.gameObject.layer == LayerMask.NameToLayer("EnemyHitBox"))
                {
                    OnHitEvent.Invoke(m_firstHit, m_currData.damage);
                }

                m_firstHit = false;

                ManageFXObject(other.gameObject);

                if (!oppDamageable.IsAlive())
                {
                    return;
                }

                BasicMovement mvmt = other.gameObject.GetComponentInParent <BasicMovement>();
                if (mvmt)
                {
                    ManageCrowdControlEffect(mvmt);
                }
            }
        }
Ejemplo n.º 2
0
        public void Pause(bool active)
        {
            if (!m_damageable.IsAlive())
            {
                return;
            }

            //Avoid running in Pause
            if (active == true)
            {
                m_movement.StopMovement();
            }

            paused = active;
            if (active)
            {
                DisableInputEvent();
            }
            else
            {
                EnableInputEvent();
            }
        }