void OnWinGameEvent(WinGameEvent e) { FadeInOut fade = GetComponent <FadeInOut>(); fade.StartFade(FadeInOut.FadeDirection.FadeOut); _timerStarted = true; }
public override void OnEvent(WinGameEvent evnt) { isGameDone = true; gameObject.GetComponent <CarController>().carSpeed = 0; winCanvas.gameObject.SetActive(true); if (labNumber < maxLabs) { winText.color = Color.red; winText.text = "You lost!"; } else { winText.color = Color.green; winText.text = "You Won!"; } }
void Update() { labCounter.text = "Lap " + labNumber + "/" + maxLabs; if (Input.GetKeyDown(KeyCode.Escape)) { PusseMenu(); } if (item.currentItem == "missile") { haj.gameObject.SetActive(true); speed.gameObject.SetActive(false); shield.gameObject.SetActive(false); } else if (item.currentItem == "speed") { haj.gameObject.SetActive(false); speed.gameObject.SetActive(true); shield.gameObject.SetActive(false); } else if (item.currentItem == "shield") { haj.gameObject.SetActive(false); speed.gameObject.SetActive(false); shield.gameObject.SetActive(true); } else if (item.currentItem == "" || item.currentItem == null) { haj.gameObject.SetActive(false); speed.gameObject.SetActive(false); shield.gameObject.SetActive(false); } if (activateCountDown) { if (isCountingDown) { CountDownStart(); } else { textCountDown.gameObject.SetActive(false); isCountingDown2 = true; } if (isCountingDown2) { SpeedometerController(); Timer(); CountDownGo(); isCountingDown2 = false; car.GetComponent <CarController>().carSpeed = 750; } } if (labNumber >= maxLabs && !isGameDone) { int counter = 0; StartCoroutine(UpdateScoreIfNeeded()); isGameDone = true; var evnt = WinGameEvent.Create(Bolt.GlobalTargets.Everyone); evnt.Send(); } }