private void WinGame() { // Checa se o jogador ganhou de Perfect (ganhar em menos de 1 segundo) if (maxTime - timeLeft <= 1) { if (GameMode.Mode == GameMode.GameModes.Minigame) { canvas.GetComponent <Animator>().SetBool("Perfect", true); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Ira"); return; } LivesController.addVidas(); canvas.GetComponent <Animator>().SetBool("Perfect", true); GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } else { if (GameMode.Mode == GameMode.GameModes.Minigame) { canvas.GetComponent <Animator>().SetBool("Won", true); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Ira"); return; } canvas.GetComponent <Animator>().SetBool("Won", true); GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } }
private void WinGame() { DespawnBeds(); if (nGreats == numberOfBeds) { if (GameMode.Mode == GameMode.GameModes.Minigame) { animator.SetTrigger("perfect"); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Preguiça"); return; } LivesController.addVidas(); animator.SetTrigger("perfect"); } else { if (GameMode.Mode == GameMode.GameModes.Minigame) { animator.SetTrigger("win"); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Preguiça"); return; } animator.SetTrigger("win"); } GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); }
private void Perfect() { if (GameMode.Mode == GameMode.GameModes.Minigame) { GetComponent <Animator>().SetTrigger("Perfect"); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Orgulho"); } else { GetComponent <Animator>().SetTrigger("Perfect"); LivesController.addVidas(); GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } }
public void Perfect() { if (GameMode.Mode == GameMode.GameModes.Minigame) { MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Ganancia"); } else { LivesController.addVidas(); GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); Screen.orientation = ScreenOrientation.AutoRotation; GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); #if UNITY_ANDROID Screen.orientation = ScreenOrientation.Landscape; Screen.orientation = ScreenOrientation.AutoRotation; #endif } }
public void RostoCerto() { if (!faceClick) { if (GetComponent <CountdownScriptInveja>().TempoContagem > 10 - difficulty - 1) { if (GameMode.Mode == GameMode.GameModes.Minigame) { perfect.gameObject.SetActive(true); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Inveja"); } perfect.gameObject.SetActive(true); LivesController.addVidas(); } else { if (GameMode.Mode == GameMode.GameModes.Minigame) { ganhou.gameObject.SetActive(true); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Inveja"); } ganhou.gameObject.SetActive(true); } foreach (GameObject errado in listaErrado) { errado.GetComponent <Animator>().SetBool("FadeOut", true); errado.GetComponent <Button>().enabled = false; } faceClick = true; if (GameMode.Mode != GameMode.GameModes.Minigame) { GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } } }
// Vence o minigame com Perfect private void Perfect() { if (GameMode.Mode == GameMode.GameModes.Minigame) { hasGameEnded = true; GetComponent <Animator>().SetTrigger("Perfect"); MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(true, "Gula"); } else { hasGameEnded = true; GetComponent <Animator>().SetTrigger("Perfect"); LivesController.addVidas(); GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); Screen.orientation = ScreenOrientation.Landscape; Screen.orientation = ScreenOrientation.AutoRotation; } }
public void RostoCerto() { faceClick = true; if (GetComponent <CountdownScript>().TempoContagem > 10 - difficulty - 1) { perfect.gameObject.SetActive(true); LivesController.addVidas(); } else { ganhou.gameObject.SetActive(true); } foreach (GameObject botao in listaDeBotoesInstanciados) { botao.GetComponent <Button>().enabled = false; } GameObject.Find("Player").GetComponent <PlayerMovement>().StartDelaySobeCarinha(); GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); }
private void LoseGame() { if (GameMode.Mode == GameMode.GameModes.Minigame) { MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>(); minigameModeController.OnMinigameFinished(false, "Preguiça"); } else { LivesController.RemVidas(); DespawnBeds(); animator.SetTrigger("lose"); // BUG FIX int nCurrentLives = LivesController.GetVidas(); if (nCurrentLives == nInitialLives - 2) { LivesController.addVidas(); } GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } }
void Update() { if (Input.GetKeyUp(KeyCode.F1)) { GameObject.Find("Player").GetComponent <PlayerMovement>().viraDeus(); } if (Input.GetKeyUp(KeyCode.M)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main"); } if (Input.GetKeyUp(KeyCode.G)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Ganancia"); } if (Input.GetKeyUp(KeyCode.I)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Ira"); } if (Input.GetKeyUp(KeyCode.P)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Preguiça"); } if (Input.GetKeyUp(KeyCode.V)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Inveja"); } if (Input.GetKeyUp(KeyCode.C)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Gula"); } if (Input.GetKeyUp(KeyCode.S)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Soberba"); //Orgulho } if (Input.GetKeyUp(KeyCode.L)) { GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Luxuria"); } if (Input.GetKeyUp(KeyCode.LeftShift)) { GameObject.Find("Player").GetComponent <PlayerMovement>().sobeCarinha(); } if (Input.GetKeyUp(KeyCode.PageUp)) { LivesController.addVidas(); } if (Input.GetKeyUp(KeyCode.PageDown)) { LivesController.RemVidas(); } //BotaoPausa if (Input.GetKeyUp(KeyCode.Escape)) { //se tiver em transicao, nao pausa o jogo. //se tiver em minigame nao pausa o jogo if (GameObject.Find("FadeImage").GetComponent <FadeController>().EmTransicao == true || !SceneManager.GetActiveScene().Equals(SceneManager.GetSceneByName("Main"))) { goto fim; } if (Time.timeScale == 0)//se já estiver pausado { GameObject.Find("PauseMenu").GetComponent <PauseMenuController>().AtivaMenu(false); } else //nao está pausado { GameObject.Find("PauseMenu").GetComponent <PauseMenuController>().AtivaMenu(true); } fim: ;//nop operation } }