void OnDisable() { for (int x = 0; x < GameObject.FindObjectsOfType <Player>().Length; x++) { PlayerShootingManager pSM = GameObject.FindObjectsOfType <Player>()[x].GetComponent <PlayerShootingManager>(); pSM.ChangeBulletDelay(pSM.originalBulletDelay); } }
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; } } }