void FireProjectile()
    {
        GenericProjectile projFired = Instantiate(projectile.gameObject, firingPoint.position, firingPoint.rotation).GetComponent <GenericProjectile> ();

        projFired.Fire();
        projFired.FireSound.Play();
        onGunFiredEvent(projFired.FireForce);
    }
Exemple #2
0
    void SpawnAsteroid()
    {
        Transform  randomSpawnArea = asteroidSpawnAreas.RandomObject();
        GameObject asteroidSpawn   = asteroidsToSpawn.RandomObject().gameObject;

        GenericProjectile spawnedAsteroid = Instantiate(asteroidSpawn, randomSpawnArea.position, randomSpawnArea.rotation).GetComponent <GenericProjectile> ();

        spawnedAsteroid.Fire();
    }