void FireProjectile() { GenericProjectile projFired = Instantiate(projectile.gameObject, firingPoint.position, firingPoint.rotation).GetComponent <GenericProjectile> (); projFired.Fire(); projFired.FireSound.Play(); onGunFiredEvent(projFired.FireForce); }
void SpawnAsteroid() { Transform randomSpawnArea = asteroidSpawnAreas.RandomObject(); GameObject asteroidSpawn = asteroidsToSpawn.RandomObject().gameObject; GenericProjectile spawnedAsteroid = Instantiate(asteroidSpawn, randomSpawnArea.position, randomSpawnArea.rotation).GetComponent <GenericProjectile> (); spawnedAsteroid.Fire(); }