Example #1
0
    protected override void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag(m_sTagName))
        {
            ReceiveDamage receiveDamage = collision.gameObject.GetComponent <ReceiveDamage>();
            if (receiveDamage.bScriptEnable != false)
            {
                if (attackForce != Vector2.zero)
                {
                    receiveDamage.AddDamageForce(attackForce);
                    m_cinemachineImpulse.GenerateImpulse();
                }

                if (m_playerInfo.IsCritical())
                {
                    m_damage = (int)((m_damage * 1.5f) + 0.5f);
                    receiveDamage.Receive(m_damage, true);
                }
                else
                {
                    receiveDamage.Receive(m_damage, false);
                }

                if (!m_playerState.IsPlayerGround())
                {
                    m_playerInfo.PlusAirAttackCount();
                }
                m_playerCombo.plusCombo();
            }
        }
    }
Example #2
0
    protected virtual void OnTriggerStay2D(Collider2D collision)
    {
        if (!longDamage)
        {
            return;
        }

        currntTime += Time.deltaTime;
        if (currntTime < damageSpaceTime)
        {
            return;
        }
        else
        {
            currntTime = 0;
        }

        if (collision.CompareTag(m_sTagName))
        {
            ReceiveDamage receiveDamage = collision.gameObject.GetComponent <ReceiveDamage>();

            if (receiveDamage.bScriptEnable != false)
            {
                if (attackForce != Vector2.zero)
                {
                    receiveDamage.AddDamageForce(attackForce);
                }
                receiveDamage.Receive(m_damage, false);
            }
        }
    }
Example #3
0
    protected virtual void OnTriggerEnter2D(Collider2D collision)
    {
        if (longDamage)
        {
            return;
        }

        if (collision.CompareTag(m_sTagName))
        {
            ReceiveDamage receiveDamage = collision.gameObject.GetComponent <ReceiveDamage>();

            if (receiveDamage.bScriptEnable != false)
            {
                if (attackForce != Vector2.zero)
                {
                    receiveDamage.AddDamageForce(attackForce);
                }
                receiveDamage.Receive(m_damage, false);
            }

            if (autoDistroy)
            {
                ObjectPool.Inst.PushToPool(this.gameObject);
            }
        }
    }
    protected override void OnTriggerEnter2D(Collider2D collision)
    {
        //if(longDamage)
        if (m_hited)
        {
            return;
        }

        if (collision.tag == m_sTagName)
        {
            ReceiveDamage receiveDamage = collision.gameObject.GetComponent <ReceiveDamage>();

            if (!receiveDamage.bScriptEnable)
            {
                return;
            }

            if (attackForce != Vector2.zero)
            {
                receiveDamage.AddDamageForce(attackForce);
                m_cinemachineImpulse.GenerateImpulse();
            }

            if (m_monsterInfo.IsCritical())
            {
                m_damage = (int)((m_damage * 1.5f) + 0.5f);
                receiveDamage.Receive(m_damage, true);
            }
            else
            {
                receiveDamage.Receive(m_damage, false);
            }

            if (autoDistroy)
            {
                ObjectPool.Inst.PushToPool(this.gameObject);
            }
        }
        if (collision.tag == "Floor")
        {
            StartCoroutine(m_projectile.InGround());
        }
    }
Example #5
0
 protected virtual void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag(m_sTagName))
     {
         ReceiveDamage receiveDamage = collision.gameObject.GetComponent <ReceiveDamage>();
         if (receiveDamage.enabled != false)
         {
             if (attackForce != Vector2.zero)
             {
                 receiveDamage.AddDamageForce(attackForce);
             }
             receiveDamage.Receive(m_damage, false);
         }
     }
 }