/// <summary> /// Perform the specified powerup action. Finds main player shoot module and invokes PlayerShoot::DoubleShootingForSeconds. /// </summary> /// <param name="player">Player tranform.</param> public override void Perform(Transform player) { if (PLAYER_SHOOT == null) { foreach (Transform t in player) { if (t.CompareTag("ShootModules")) { foreach (Transform shootModules in t) { if (shootModules.CompareTag("MainShootModule")) { PLAYER_SHOOT = shootModules.GetComponent <PlayerShoot>(); break; } } } } } if (PLAYER_SHOOT != null) { PLAYER_SHOOT.DoubleShootingForSeconds(secPowerUp); } PARTICLE_EXPLOSION.Spawn(transform.position, numOfParticlesToSpawn, particleColour); ShowMessage("DOUBLE SHOT"); Destroy(gameObject); }
/// <summary> /// Perform the specified powerup action. Finds main player shoot module and invokes PlayerShoot::DecrementSecBetweenShotsForSeconds. /// </summary> /// <param name="player">Player tranform.</param> public override void Perform(Transform player) { if (PLAYER_SHOOT == null) { foreach (Transform t in player) { if (t.CompareTag("ShootModules")) { foreach (Transform shootModules in t) { if (shootModules.CompareTag("MainShootModule")) { PLAYER_SHOOT = shootModules.GetComponent <PlayerShoot>(); break; } } } } } if (PLAYER_SHOOT != null) { PLAYER_SHOOT.DecrementSecBetweenShotsForSeconds(secsBetweenShotDecrement, secSpeedIncrease); } PARTICLE_EXPLOSION.Spawn(transform.position, numOfParticlesToSpawn, particleColour); ShowMessage("SHOOT SPEED"); Destroy(gameObject); }
/// <summary> /// Perform the specified powerup action. Spawns additional particles at powerup location. /// </summary> /// <param name="player">Player tranform.</param> public override void Perform(Transform player) { PARTICLE_EXPLOSION.Spawn(transform.position, numOfParticlesToSpawn, particleColour); ShowMessage("BONUS SCORE"); Destroy(gameObject); }
/// <summary> /// Perform the specified powerup action. Invokes PlayerController::IncrementSpeedForSeconds /// </summary> /// <param name="player">Player tranform.</param> public override void Perform(Transform player) { var controller = player.GetComponent <PlayerController>(); controller.IncrementSpeedForSeconds(speedIncrease, secSpeedIncrease); PARTICLE_EXPLOSION.Spawn(transform.position, numOfParticlesToSpawn, particleColour); ShowMessage("SPEED BOOST"); Destroy(gameObject); }