//implement effect based on kind of power up void powerupEffect(s_Sailer mySailer) { switch (KindOfPowerUp) { case PowerUpType.SHIELD: mySailer.ActivateShield(); break; case PowerUpType.HEALTH: mySailer.Repair(3); break; case PowerUpType.FUEL: mySailer.GetThrusters().AddFuel(mySailer.GetThrusters().GetMaxFuel() * 0.1f); break; case PowerUpType.LASER: mySailer.AddLaser(25); break; case PowerUpType.AUTOSTOP: mySailer.SetAutoStop(true); break; case PowerUpType.RADAR: mySailer.SetRadar(true); break; default: break; } }
void Awake() { if (Singleton != null && Singleton != this) { Destroy(gameObject); } else { Singleton = this; } }
public void OnCollisionEnter(Collision c) { s_Sailer sailer = c.gameObject.GetComponent <s_Sailer>(); if (sailer != null && currentState == state.alive) { AudioControlerScript.Singleton.PlayPowerupCollected_snd(s_Sailer.Singleton.transform.position, false, 0.5f); powerupEffect(sailer); die(); } }