void FireUp() { _muzzle3.transform.position = transform.TransformPoint(0, 0.23f, 0); if (_bulletType == _BulletType.Basic) { Instantiate(_bulletToTop, _muzzle3.transform.position, transform.rotation); } if (_bulletType == _BulletType.Rebound1) { if (_Rebound1Bullets > 0) { StartCoroutine("FireRebound1Top"); } } if (_Rebound1Bullets <= 0) { _bulletType = _BulletType.Basic; } if (_bulletType == _BulletType.Rebound2) { if (_Rebound2Bullets > 0) { StartCoroutine("FireRebound2Top"); } } if (_Rebound2Bullets <= 0) { _bulletType = _BulletType.Basic; } }
void FiretoLeft() { if (_bulletType == _BulletType.Basic) { Instantiate(_bulletToLeft, _muzzle2.transform.position, transform.rotation); } if (_bulletType == _BulletType.Rebound1) { if (_Rebound1Bullets > 0) { StartCoroutine("FireRebound1L"); } } if (_Rebound1Bullets <= 0) { _bulletType = _BulletType.Basic; } if (_bulletType == _BulletType.Rebound2) { if (_Rebound2Bullets > 0) { StartCoroutine("FireRebound2L"); } } if (_Rebound2Bullets <= 0) { _bulletType = _BulletType.Basic; } }
void ChangeAmmo() { if (Input.GetKeyDown(KeyCode.E) && _Rebound1Bullets <= 1) { Debug.Log("Change Ammo BRebound"); _bulletType = _BulletType.Rebound1; } }
IEnumerator FireRebound2L() { Instantiate(_bulletR2ToLeft, _muzzle3.transform.position, transform.rotation); _Rebound1Bullets -= 1; yield return(new WaitForSeconds(0)); if (_Rebound2Bullets > 0) { StartCoroutine("FireRebound2L"); } else { _bulletType = _BulletType.Basic; StopCoroutine("FireRebound2L"); } }