public void RapidFire(Player.PlayerIdentity identity)
 {
     for (int x = 0; x < GameObject.FindObjectsOfType <Player>().Length; x++)
     {
         if (GameObject.FindObjectsOfType <Player>()[x].identifier == identity)
         {
             GameObject.FindObjectsOfType <Player>()[x].GetComponent <PlayerShootingManager>().ChangeBulletDelay(autoBlasterDelayAmount);
         }
     }
 }
Esempio n. 2
0
    public void SetUpLaserAssault(Player.PlayerIdentity identity, float laserBeamSpeed, float laserLifespan, float topRotation, float bottomRotation)
    {
        playerWhoSpawnedIt  = identity;
        laserSpeed          = laserBeamSpeed;
        laserLife           = laserLifespan;
        topLaserRotation    = topRotation;
        bottomLaserRotation = bottomRotation;

        laserAppear   = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultAppear);
        laserCharging = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultCharge);
        laserFiring   = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultFiring);

        laserAppear.PlayAudioClip();
    }
Esempio n. 3
0
    public void SetUpLauncher(Player.PlayerIdentity identity, float speed, int missles, float explosionTime, Powerup pu)
    {
        missleFireSound          = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.MissleFiring);
        misslePrefab             = Resources.Load("Powerups/MisslesAndLasers/Missle") as GameObject;
        missleSpeed              = speed;
        missleAmount             = missles;
        powerup                  = pu;
        timeUntilMissleExplosion = explosionTime;

        for (int x = 0; x < GameObject.FindObjectsOfType <Player>().Length; x++)
        {
            if (GameObject.FindObjectsOfType <Player>()[x].identifier == identity)
            {
                player                = GameObject.FindObjectsOfType <Player>()[x].gameObject;
                playerShooter         = player.GetComponent <PlayerShootingManager>();
                playerShooter.enabled = false;
            }
        }
    }
Esempio n. 4
0
 protected virtual void OnTriggerEnter(Collider collider)
 {
     if (collider.GetComponent <Bullet>() && powerupState != PowerupState.NONE)
     {
         shooterIdentity = collider.GetComponent <Bullet>().manager.shooterIdentity;
         DropPowerupOnDeath();
         this.gameObject.SetActive(false);
         meteorSound.PlayAudioClip();
     }
     else if (collider.GetComponent <Bullet>() && powerupState == PowerupState.NONE)
     {
         shooterIdentity = collider.GetComponent <Bullet>().manager.shooterIdentity;
         this.gameObject.SetActive(false);
         meteorSound.PlayAudioClip();
     }
     if (collider.GetComponent <Missle>())
     {
         shooterIdentity = collider.GetComponent <Missle>().missleLauncher.player.GetComponent <Player>().identifier;
         DropPowerupOnDeath();
         meteorSound.PlayAudioClip();
     }
 }
Esempio n. 5
0
 public virtual void GrabPlayerWhoEarnedIt(Player.PlayerIdentity identity)
 {
     playerWhoEarnedPowerup = identity;
 }