Exemplo n.º 1
0
        void OnCollisionEnter2D(Collision2D other)
        {
            if ((_onHit != 2) && (other.collider.name == "BS_Boss") && (!_isInvincible))
            {
                if (!_isDead)
                {
                    GenEffect(Get_Angle_byPosition(this.transform.position, other.collider.GetComponent <Transform>().position), 25f, 2f, 10);
                    OnDamage();
                }
            }
            if ((_onHit == 2) && (other.collider.name == "BS_Boss"))
            {
                GenEffect(Get_Angle_byPosition(other.collider.GetComponent <Transform>().position, this.transform.position) + 60f, 30f, 3f, 8);
                GenEffect(Get_Angle_byPosition(other.collider.GetComponent <Transform>().position, this.transform.position) - 60f, 30f, 3f, 8);

                BossBehavior bossScript = other.collider.GetComponent <BossBehavior>();
                bossScript.OnDamaged(Math_Boss_Damage());
                _attackSuccess = true;
                _animController.AttackSuccess();
            }

            if (other.collider.tag != "Wall")
            {
                TimerAttackReset();
            }
        }