void FireGun() { if (Input.GetButton("Fire1")) { if (fireRateTimer <= 0f) { //Debug.Log("Fire!"); GameObject bullet = Instantiate(gunProperties.GetBulletPrefab(), gunProperties.GetBulletTransform().position, gunProperties.GetBulletTransform().rotation, gunProperties.GetBulletsInHierarchyTransform()); fireRateTimer = gunProperties.GetFireRate(); shootAudio.Play(); } } fireRateTimer -= Time.deltaTime; }
public Vector3 GetFireDirection() { return((gunProperties.GetBulletTransform().position - fireDirectionPoint).normalized); }