// Update is called once per frame void Update() { if (m_Timer > 0) { m_Timer -= Time.deltaTime; } if (m_Timer <= 0 && isFiring) { if (m_NumSpecialAmmo > 0 && specialBulletPrefab != null) { GameObject bullet = Instantiate(specialBulletPrefab, m_Transform.position, m_Transform.rotation); bullet.transform.localScale = GameManager.instance.gameScale; if (m_audioSource != null) { m_audioSource.PlayOneShot(specialAmmoFireClip); } HapticAbstraction.BuzzBothHands(hapticTime); m_NumSpecialAmmo--; } else if (bulletPrefab != null) { GameObject bullet = Instantiate(bulletPrefab, m_Transform.position, m_Transform.rotation); bullet.transform.localScale = GameManager.instance.gameScale; if (m_audioSource != null) { m_audioSource.Play(); } HapticAbstraction.BuzzBothHands(hapticTime); } m_Timer = cooldown; } }
// Update is called once per frame void Update() { if (m_Timer > 0) { m_Timer -= Time.deltaTime; } if (m_Timer <= 0 && InputAbstraction.FireControlActive(InputAbstraction.PreferedHand())) { if (m_NumSpecialAmmo > 0 && specialBulletPrefab != null) { Instantiate(specialBulletPrefab, m_Transform.position, m_Transform.rotation); if (m_audioSource != null) { m_audioSource.PlayOneShot(specialAmmoFireClip); } HapticAbstraction.BuzzBothHands(hapticTime); m_NumSpecialAmmo--; } else if (bulletPrefab != null) { Instantiate(bulletPrefab, m_Transform.position, m_Transform.rotation); if (m_audioSource != null) { m_audioSource.Play(); } HapticAbstraction.BuzzBothHands(hapticTime); } m_Timer = cooldown; } }