コード例 #1
0
 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);
         }
     }
 }
コード例 #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();
    }
コード例 #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;
            }
        }
    }
コード例 #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();
     }
 }
コード例 #5
0
 public virtual void GrabPlayerWhoEarnedIt(Player.PlayerIdentity identity)
 {
     playerWhoEarnedPowerup = identity;
 }