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

        projFired.Fire();
        projFired.FireSound.Play();
        onGunFiredEvent(projFired.FireForce);
    }
示例#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();
    }