Ejemplo n.º 1
0
        public void ProcessEffect(Collider2D other)
        {
            // 땅체크는 Layer로 하고 _isCharging 중단 체크는 tag로 하기 때문에
            // 땅의 tag가 정해져 있지 않으면 문제가 생기는 경우가 있음
            // Physics Controller로 옮겨야 하나
            // 어떻게 해야할지 고민 중에 있음
            switch (other.tag)
            {
            case "Platform":
                ctw_Platform_behavior PlatformScript = other.GetComponent <ctw_Platform_behavior>();

                if ((PlatformScript.Trigger == false) && (_rigid.velocity.y <= 0))
                {
                    if (_physicManager._onAir)
                    {
                        GenEffect(0f, 15f, 1f, 3);
                        GenEffect(180f, 15f, 1f, 3);
                    }
                    _attackSuccess = false;
                    _isCharging    = false;
                }
                break;

            case "Ground":
                if (_physicManager._onAir && (_rigid.velocity.y <= -1f))
                {
                    GenEffect(0f, 15f, 1f, 3);
                    GenEffect(180f, 15f, 1f, 3);
                }
                _attackSuccess = false;
                _isCharging    = false;
                break;
            }
        }
Ejemplo n.º 2
0
    void OnTriggerStay2D(Collider2D other)
    {
        switch (other.tag)
        {
        case "Platform":

            ctw_Platform_behavior PlatformScript = other.GetComponent <ctw_Platform_behavior>();

            if ((PlatformScript.Trigger == false) && (PlayerRigid2D.velocity.y <= 0))
            {
                if (OnAir == 1)
                {
                    GenEffect(0f, 15f, 1f, 3);
                    GenEffect(180f, 15f, 1f, 3);
                }
                OnAir = 0;
            }
            break;

        case "Bullet":
            if (Invincible == 0)
            {
                ctw_Bullet_Collider_Script BulletScript = other.GetComponent <ctw_Bullet_Collider_Script>();
                if ((DEAD != 1) && (BulletScript.OnWork == true))
                {
                    GenEffect(Get_Angle_byPosition(PlayerTransform.position, other.GetComponent <Transform>().position) + 35f, 15f, 1f, 3);
                    GenEffect(Get_Angle_byPosition(PlayerTransform.position, other.GetComponent <Transform>().position) - 35f, 15f, 1f, 3);
                    OnDamage();
                }
                BulletScript.Hitted();
            }
            break;

        case "Ground":
            if ((OnAir == 1) && (PlayerRigid2D.velocity.y <= -1f))
            {
                GenEffect(0f, 15f, 1f, 3);
                GenEffect(180f, 15f, 1f, 3);
            }
            OnAir = 0;
            break;
        }
    }