Example #1
0
    void UpdateShotBullet()
    {
        if (m_knockback > 0.0f)
        {
            m_knockback -= Time.deltaTime;
            return;
        }

        if (m_magazine.isReloading)
        {
            return;
        }

        if (m_charCtrl.isLauncherStance)
        {
            if (m_input.IsShotHolded())
            {
                if (m_magazine.bulletNum < m_costBullet)
                {
                    StartReload();
                }
                else
                {
                    m_chargeTime += Time.deltaTime;
                }
            }
            else
            {
                if (m_chargeTime > 0.0f)
                {
                    if ((m_chargeTime >= m_chargeShotTime) && (m_magazine.bulletNum >= m_costChargeBullet))
                    {
                        LaunchBouquet();
                    }
                    else if (m_magazine.bulletNum >= m_costBullet)
                    {
                        LaunchBullet();
                    }
                    m_chargeTime = 0.0f;
                }
            }
        }
        else
        {
            if (m_input.IsShotHolded())
            {
                if (m_magazine.bulletNum < m_costBullet)
                {
                    StartReload();
                }
                else
                {
                    m_chargeTime += Time.deltaTime;
                }
            }
            else
            {
                if (m_chargeTime > 0.0f)
                {
                    if (m_magazine.bulletNum >= m_costBullet)
                    {
                        LaunchBullet();
                    }
                    else
                    {
                        StartReload();
                    }
                    m_chargeTime = 0.0f;
                }
            }
        }

        if ((m_chargeTime >= m_chargeShotTime) && (m_magazine.bulletNum >= m_costChargeBullet))
        {
            m_csEfCharging.SleepEffect();
            m_csEfMaxCharge.WakeupEffect();
        }
        else if ((m_chargeTime >= 0.250f) && (m_magazine.bulletNum >= m_costChargeBullet))
        {
            m_csEfCharging.WakeupEffect();
        }
        else
        {
            m_csEfCharging.SleepEffect();
            m_csEfMaxCharge.SleepEffect();
        }
    }
    void UpdateShotBullet()
    {
        if (m_knockback > 0.0f)
        {
            m_knockback -= Time.deltaTime;
            return;
        }

        if (m_magazine.isReloading)
        {
            return;
        }

        if (m_input.IsShotHolded())
        {
            m_chargeTime += Time.deltaTime;
        }
        else
        {
            if (m_chargeTime > 0.0f)
            {
                if (!m_magazine.isReloading)
                {
                    if ((m_chargeTime >= m_chargeShotTime) && (m_magazine.bulletNum >= m_costChargeBullet))
                    {
                        bool isShot3WayBullet = m_input.Dbg_IsShot3Way();
                        if (isShot3WayBullet)
                        {
                            Launch3WayBouquet();
                        }
                        else
                        {
                            LaunchBouquet();
                        }
                    }
                    else if (m_magazine.bulletNum >= m_costBullet)
                    {
                        bool isShot3WayBullet = m_input.Dbg_IsShot3Way();
                        if (isShot3WayBullet)
                        {
                            Launch3WayBullet();
                        }
                        else
                        {
                            LaunchBullet();
                        }
                    }
                    else
                    {
                        StartReload();
                    }
                }
                m_chargeTime = 0.0f;
            }
        }

        if ((m_chargeTime >= m_chargeShotTime) && (m_magazine.bulletNum >= m_costChargeBullet))
        {
            m_csEfMaxCharge.WakeupEffect();
        }
        else
        {
            m_csEfMaxCharge.SleepEffect();
        }
    }