public override void SuccessfullyClick() { if (rb != null && gameObject != null) { if (!pointsEarned && PowerUpButton.activePowerUps.Count > 0 && Random.Range(0, Random.Range(85, 95)) < 2) { PowerUp powerUp = PowerUpButton.DeterminePowerUp(); ClickForPoints2D spawn = ObjectSpawner.GetSpawn(powerUp); spawn = Instantiate(spawn, null); spawn.Reposition(transform.position); spawn.transform.parent = null; spawn.gameObject.SetActive(true); } rb.isKinematic = false; rb.AddForce(Vector3.down * 200f, ForceMode.Acceleration); base.SuccessfullyClick(); MaterialChanger m = GetComponentInChildren <MaterialChanger>(); if (m != null) { m.enabled = true; } Collider c = GetComponent <Collider>(); if (c != null) { Destroy(c); } } }
public void AumentarAlcanceBasico(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetFloat("+Alcance", 0.1f); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetFloat("+Alcance", 0.2f); } }
public void AumentaAreaDaPocaSecundario(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetInt("+AreaDePoça", 1); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetInt("+AreaDePoça", 2); } }
public void AumentarDuracaoEspecial(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetFloat("Especial+Duraçao", 1); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetFloat("Especial+Duraçao", 2); } }
public void AumentarLentidaoSecundario(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetFloat("+SlowDown", 0.5f); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetFloat("+SlowDown", 1f); } }
public void DiminuirCoolDownSecudario(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetFloat("+Rapido", 2); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetFloat("+Rapido", 3); } }
public void AumentarAreaEspecial(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetInt("Especial+Area", 1); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetInt("Especial+Area", 2); } }
public void AumentarDanoEspecial(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetFloat("Especial+Dano", 0.15f); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetFloat("Especial+Dano", 0.3f); } }
public void IndefinidoBasico(PowerUpButton button)//aumenta a porcentagem de chance de +50% de dano { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetInt("+ChanceDe+Dano", 5); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetInt("+ChanceDe+Dano", 8); } }
public void AumentarProjetilBasico(PowerUpButton button) { if (button.VerificarAtivacao() == 1) { PlayerPrefs.SetInt("Skill1Bullets", 1); PlayerPrefs.SetFloat("+Dano", 0.05f); } else if (button.VerificarAtivacao() == 2) { PlayerPrefs.SetInt("Skill1Bullets", 2); PlayerPrefs.SetFloat("+Dano", 0.1f); } }
private void initializePowerUps() { var powerUpButtons = new PowerUpButton[4]; powerUpButtons[0] = Instantiate(CustomResources.Load <GameObject>("PowerUps/PowerUpButton")).GetComponent <PowerUpButton>(); powerUpButtons[0].Initialize(PowerUpType.Fire, 1, onSelectPowerUp); powerUpButtons[1] = Instantiate(CustomResources.Load <GameObject>("PowerUps/PowerUpButton")).GetComponent <PowerUpButton>(); powerUpButtons[1].Initialize(PowerUpType.Water, 1, onSelectPowerUp); powerUpButtons[2] = Instantiate(CustomResources.Load <GameObject>("PowerUps/PowerUpButton")).GetComponent <PowerUpButton>(); powerUpButtons[2].Initialize(PowerUpType.Earth, 1, onSelectPowerUp); powerUpButtons[3] = Instantiate(CustomResources.Load <GameObject>("PowerUps/PowerUpButton")).GetComponent <PowerUpButton>(); powerUpButtons[3].Initialize(PowerUpType.Air, 1, onSelectPowerUp); PowerUpBar.Initialize(powerUpButtons); }
public override void ReInit() { base.ReInit(); #if (PUBLISHING_PLATFORM_AMAZON) ButtonTurnOffAds.SetActive(false); #endif ResetPowerupsAmount(); Powerups = new Dictionary <GameData.PowerUpType, PowerUpButton>(); for (int i = 0; i < 4; ++i) { Transform transf = transform.Find("BoosterButton_" + i.ToString()); if (transf != null) { PowerUpButton script = transf.GetComponent <PowerUpButton>(); Powerups.Add(script.PowerupType, script); //script.ResetPowerup(); } } GameManager.Instance.BoardData.AGameBoard.PlayGame(); }
public RaceSubScene() : base(Definitions.IsWideScreen ? Wide_Buffer_Width : Standard_Buffer_Width, Buffer_Height) { StatusDisplay = new RaceDataDisplay(); Communicator = null; _countdownPopup = new CountdownPopup(); _powerUpButton = new PowerUpButton(); _playerEventPopup.AnimationCompletionHandler = HandlePlayerEventAnimationComplete; _powerUpDisplayTimer = new PowerUpTimer(); _powerUpDisplayTimer.TickCallback = _timerController.RegisterUpdateCallback; _powerUpHelper = new PowerUpHelper(); _blackout = new Blackout(); _blackout.TickCallback = _timerController.RegisterUpdateCallback; _positionStatusPopup = new RaceInfoPopup(); _raceEventPopup = new RaceInfoPopup(); _exitTimer = new Timer("", HandleExitTimerActionComplete); GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_exitTimer.Tick); }
public RaceGameplayScene() : base("race-gameplay") { StatusDisplay = new RaceDataDisplay(); _countdownPopup = new CountdownPopup(); _quitRaceButton = new QuitRaceButton(); _powerUpButton = new PowerUpButton(); _playerEventPopup.AnimationCompletionHandler = HandlePlayerEventAnimationComplete; _powerUpDisplayTimer = new PowerUpTimer(); _powerUpDisplayTimer.TickCallback = _timerController.RegisterUpdateCallback; _powerUpHelper = new PowerUpHelper(); _blackout = new Blackout(); _blackout.TickCallback = _timerController.RegisterUpdateCallback; _positionStatusPopup = new RaceInfoPopup(); _raceEventPopup = new RaceInfoPopup(); _waitingMessage = new WaitingMessage(); _exitTimer = new Timer("", HandleExitTimerActionComplete); GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_exitTimer.Tick); _startSequenceTimer = new Timer("", HandleStartCountdownStep); GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_startSequenceTimer.Tick); _quitTimer = new Timer("", HandleQuitTimerActionComplete); GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_quitTimer.Tick); _quitRaceDialog = new QuitRaceDialog(); _quitRaceDialog.CancellationTimer = _quitTimer; _quitRaceDialog.InputSources.Add(_inputProcessor); _disconnectedDialog = new DisconnectedDialog(); _disconnectedDialog.SelectionCallback = HandleDisconnectAcknowledge; _disconnectedDialog.InputSources.Add(_inputProcessor); }