protected override Rigidbody2D JointObject(Rigidbody2D _RigidbodyObject)
 {
     if (_RigidbodyObject)
     {
         ShotCooldown     = 1;
         CurrentShotDelay = ShotDelay;
         Cannon.HeadBulletCharge(_RigidbodyObject);
         Observer.ChangeState(false);
         Debug.Log("장전");
     }
     return(base.JointObject(_RigidbodyObject));
 }
Beispiel #2
0
    private void ThrowHead()
    {
        //        m_Joint.connectedBody = null;
        //        m_Joint.enabled = false;
        //cannon
        // CurrentAxis
        m_Collider.offset = Vector2.up * 0.6f;
        m_Collider.size   = new Vector2(1, 1.2f);

        if (CurrentAxis.y > 0.2f)
        {
            cannon.direction = ThrowDir_Up;
        }
        else if (CurrentAxis.y < -0.2f)
        {
            cannon.direction = ThrowDir_Down;

            m_CurrentHead.transform.SetParent(null);
            m_CurrentHead.gameObject.tag = TempTagSaver;
            m_CurrentHead.simulated      = true;
            m_CurrentHead = null;
            return;
        }
        else
        {
            if (Mathf.Abs(CurrentAxis.x) > 0.2f)
            {
                cannon.direction = ThrowDir_Forward;
            }
            else
            {
                cannon.direction = ThrowDir_Normal;
            }
        }


        m_CurrentHead.transform.SetParent(null);
        m_CurrentHead.gameObject.tag = TempTagSaver;
        m_CurrentHead.simulated      = true;
        cannon.HeadBulletCharge(m_CurrentHead);
        m_CurrentHead = null;
        cannon.SetState(true);
    }