Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        UpdateReloadBullet();
        UpdateShotBullet();

        Vector2 vec = Vector2.zero;

        if (m_charCtrl.isLauncherStance)
        {
            vec          = m_input.RotateLauncher();
            m_pitchAngle = (m_pitchAngle + vec.y * m_pitchSpeed * Time.deltaTime).MaxLimited(m_maxPitchAngle).MinLimited(m_minPitchAngle);
        }
        else
        {
            m_pitchAngle = Mathf.LerpAngle(m_pitchAngle, m_stdPitchAngle, m_pitchSpeed * Time.deltaTime * 0.050f);  // HACK NUM
        }
        this.transform.localRotation = Quaternion.AngleAxis(-m_pitchAngle, Vector3.right);

        m_parent.Rotate(Vector3.up, vec.x * m_yawSpeed * Time.deltaTime, Space.World);

#if DEBUG
        if (m_input.Dbg_IsUnlimitedBullet())
        {
            m_magazine.StartUnlimitedBullet(10.0f); // TODO
        }

        if (m_input.Dbg_IsShot3Way())
        {
            m_magazine.ReloadBonus3WayBullet(3); // TODO
        }

        if (m_input.Dbg_IsReloadBonusCharm())
        {
            m_magazine.ReloadBonusCharmBullet(6); // TODO
        }
#endif
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        UpdateReloadBullet();
        UpdateShotBullet();

        Vector2 vec = m_input.RotateLauncher();

        m_pitchAngle = (m_pitchAngle + vec.y * m_pitchSpeed * Time.deltaTime).MaxLimited(m_maxPitchAngle).MinLimited(m_minPitchAngle);
        this.transform.localRotation = Quaternion.AngleAxis(-m_pitchAngle, Vector3.right);

        m_parent.Rotate(Vector3.up, vec.x * m_yawSpeed * Time.deltaTime, Space.World);

#if DEBUG
        if (m_input.Dbg_IsUnlimitedBullet())
        {
            m_magazine.StartUnlimitedBullet(10.0f); // TODO
        }

        if (m_input.Dbg_IsReloadBonusCharm())
        {
            m_magazine.ReloadBonusCharmBullet(6); // TODO
        }
#endif
    }