// 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 }
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(); } }