private void GameOver() { Initiate.Fade(gameOver, loadToColor, speed); }
private void OnMouseDown() { Initiate.Fade("chapterScreen3", Color.black, 10f); }
void TaskOnClick() { source.Play(); Initiate.Fade("Game", Color.black, 2); }
void FixedUpdate() { if (isClosing && uiState == "punish") { foreach (GameObject player in players) { if (player.transform.position.z < -5 || player.transform.position.z > 5 || player.transform.position.x < -5 || player.transform.position.x > 5) { //player.GetComponent<PlayerController>().lightning.enabled = true; player.GetComponent <PlayerController>().punishPlayerLight(); } } enemies = GameObject.FindGameObjectsWithTag("enemy"); foreach (GameObject enemy in enemies) { enemy.GetComponent <LittleBlobController>().die(); } uiState = "endgame"; } if (isCutscene) { if (openTimer > 3) { foreach (GameObject player in players) { player.transform.Translate(Vector3.forward * Time.deltaTime * 2.5f); } } openTimer -= Time.deltaTime; //if (openTimer < 8 && uiState == "begin") //{ // uiState = "text1"; // UIcanvas.setInstructions("Don't let this little guy push you off for a reward!"); //} if (openTimer < 3 && uiState == "begin") { uiState = "text2"; UIcanvas.setInstructions("Just stay within the yellow lines..."); } else if (openTimer < 0 && uiState == "text2") { isCutscene = false; foreach (GameObject player in players) { //player.GetComponent<PlayerController>().lightning.enabled = false; player.GetComponent <PlayerController>().enabled = true; } //enemy.GetComponent<BlobController>().enabled = true; UIcanvas.startTimer(30); uiState = "gameplay"; sounds[0].Play(); } } if (UIcanvas.uiTimer <= 0 && !isClosing && uiState == "gameplay") { isClosing = true; uiState = "punish"; sounds[0].Stop(); } if (isClosing) { closingTimer -= Time.deltaTime; } if (closingTimer < 0 && isClosing) { uiState = "nextLevel"; isClosing = false; ScoreBehavior.levels.RemoveAt(0); if (ScoreBehavior.levels.Count == 0) { Initiate.Fade("End Level", Color.black, 2f); } else { string nextLevel = ScoreBehavior.levels[0]; Initiate.Fade(nextLevel, Color.black, 2f); } } }
private void Start(Initiate initiate) { this.logger.Info(NLog.LogLevel.Info); router.Tell(initiate); }
//global scene loader public void LevelLoader(string scene_name) { Initiate.Fade(scene_name, Color.black, 3f); }
public void GoFade() { Initiate.Fade(scene, loadToColor, 1.0f); }
public void ClickOnRestart() //If user click on restart, I reload the current scene { Initiate.Fade(SceneManager.GetActiveScene().name, Color.black, 0.9f); }
public void ReturnMenu() //If user click on return menu, I load the "Menu" scene { Initiate.Fade("Menu", Color.black, 0.8f); }
public void StartGame() { Initiate.Fade(scene, loadToColor, 1.0f); }
// Start is called before the first frame update void Start() { HealthText = GameObject.Find("Health Number").GetComponent <TextMeshProUGUI>(); player = GameObject.FindWithTag("player").GetComponent <Player>(); levelInfo = GameObject.FindWithTag("Initiate").GetComponent <Initiate>(); }
void Update() { if (!boss) { if (currentHealth < minHealth) { anim.SetBool("attack", false); anim.SetBool("die", true); Object.Destroy(gameObject, .6f); //anim.SetBool("die", false); if (first) { enemies.GetComponent <waveScript>().enemmiesDiedPlus(); first = false; } } } else if (boss) { if (currentHealth < maxHealth / 4 * 3 && currentHealth > maxHealth / 2) { targetPlayer(); } if (currentHealth < maxHealth / 2 - dronespawnhealth && currentHealth > maxHealth / 4) { spawnDrones(4); dronespawnhealth += dronehealthloss; } if (currentHealth < maxHealth / 4 && currentHealth > minHealth) { targetMoederboord(); } if (currentHealth < minHealth) { Destroy(gameObject); Initiate.Fade(scene3, Color.black, 0.5f); //SceneManager.LoadScene("Win"); GameObject.Find("Audio Source").GetComponent <backgroudSound>().clip = 2; GameObject.Find("Audio Source").GetComponent <backgroudSound>().win = true; } } if (gameObject.GetComponent <EnemyMovement>().forward) { anim.SetBool("attack", true); } else { anim.SetBool("attack", false); } /* if (Input.GetKeyDown(KeyCode.H)) * { * * Debug.Log("testbutton"); * anim.SetBool("die", true); * * } * else * { * * anim.SetBool("die", false); * } */ }
void FixedUpdate() { if (isClosing && uiState == "punish") { foreach (GameObject player in players) { } uiState = "endgame"; } if (uiState == "gameplay") { foreach (GameObject player in players) { } } if (isCutscene) { //if (openTimer > 3) //{ // foreach (GameObject player in players) // { // player.transform.Translate(Vector3.forward * Time.deltaTime * 2.5f); // } //} openTimer -= Time.deltaTime; //if (openTimer < 8 && uiState == "begin") //{ // uiState = "text1"; // UIcanvas.setInstructions("Stab your peers' back to steal some gold."); //} if (openTimer < 3 && uiState == "begin") { uiState = "text2"; UIcanvas.setInstructions("Reach the yellow goal up north!"); } else if (openTimer < 0 && uiState == "text2") { isCutscene = false; foreach (GameObject player in players) { //player.GetComponent<PlayerController>().lightning.enabled = false; player.GetComponent <PlayerController>().enabled = true; } UIcanvas.startTimer(60f); uiState = "gameplay"; sounds[0].Play(); } } if (UIcanvas.uiTimer <= 0 && !isClosing && uiState == "gameplay") { isClosing = true; uiState = "punish"; sounds[0].Stop(); } if (isClosing) { closingTimer -= Time.deltaTime; } if (closingTimer < 0 && isClosing) { uiState = "nextLevel"; isClosing = false; ScoreBehavior.levels.RemoveAt(0); if (ScoreBehavior.levels.Count == 0) { Initiate.Fade("End Level", Color.black, 2f); } else { string nextLevel = ScoreBehavior.levels[0]; Initiate.Fade(nextLevel, Color.black, 2f); } } }
//Carrega a primeira fase public void goToScene() { Initiate.Fade(cenaParaCarregar, Color.white, 2); //SceneManager.LoadScene(cenaParaCarregar); }
public void VolverMenu() { Time.timeScale = 1; Initiate.Fade("Menu", Color.black, 1); }
//-------------------------------------------------------------------------------------------------- public void MainMenuButtonPressed() { Debug.Log("You have pressed Main Menu Button"); Initiate.Fade(scene, loadToColor, fadeTime); }
public void StartGame() { Initiate.Fade("InGame", Color.black, .2f); }
public void Transition() { Initiate.Fade("example-scene-1", new Color(1, 1, 1), 1.0f); }
public void OnClickInGameFinish() { Initiate.Fade("Main UI", Color.black, 0.3f); }
public void StartLevel() { string nextPath = UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(0); Initiate.Fade(nextPath, Color.black, 1.0f); }
IEnumerator Verifier() { int time = 0; while (checking) { time = time + 1; yield return(null); if (hit.transform.tag == "start" && Input.GetButton("Fire1")) { select_bar.localScale = new Vector3(time * 0.02f, 1f, 1f); if (time > 50) { checking = false; audio_source.clip = chose; audio_source.Play(); last_game_object = null; barRect.transform.position = new Vector3(0, -0.60f, 5.5f); Destroy(start_menu.gameObject); } } else if (hit.transform.tag == "play" && Input.GetButton("Fire1")) { select_bar.localScale = new Vector3(time * 0.02f, 1f, 1f); if (time > 50) { audio_source.clip = confirm; audio_source.Play(); last_game_object = null; bar.GetComponent <Canvas> ().enabled = false; Destroy(instructions.gameObject); StartCoroutine(EndAnimation()); } } else if (hit.transform.tag == "exit" && Input.GetButton("Fire1")) { select_bar.localScale = new Vector3(time * 0.02f, 1f, 1f); if (time > 50) { checking = false; Initiate.FadeDefault("VR_MainMenu"); // Application.LoadLevel ("VR_MainMenu"); } } else if (hit.transform.tag == "quit" && Input.GetButton("Fire1") && paused) { select_bar.localScale = new Vector3(time * 0.02f, 1f, 1f); if (time > 50) { Application.Quit(); } } else { checking = false; } } time = 0; select_bar.localScale = new Vector3(0, 1f, 1f); }
public void changeScreen() { Initiate.Fade("Arcade_Lvl_Difficulty", Color.black, 10f); }
public static void Load(string scene, Color color, float multiplier) { Initiate.Fade(scene, color, multiplier); }
public void ModeSelect() { StartCoroutine("Wait"); Initiate.Fade("WiegmanRussoContrast", Color.black, 1.0f); }
void LoadScene() { Initiate.Fade(levelToLoad, loadToColor, 3.0f); }
void Fade() { Initiate.Fade("Stage2", Color.black, 1.0f); }
void Play() { FindObjectOfType <AudioManager>().Stop("MainMenu"); FindObjectOfType <AudioManager>().Play("Theme"); Initiate.Fade("Main", Color.black, 3.0f); }
void OnMouseDown() { Debug.Log("Button Clicked"); Initiate.Fade("MidiVisualizer", Color.white, 0.75f); }
public void Confirm() { Initiate.FadeDefault("Totem_ChooseYourSeat"); }
void FixedUpdate() { if (isClosing && uiState == "punish") { uiState = "endgame"; } if (uiState == "gameplay") { } if (isCutscene) { if (openTimer > 42) { foreach (GameObject player in players) { player.transform.Translate(Vector3.forward * Time.deltaTime * 2.5f); } } openTimer -= Time.deltaTime; if (openTimer < 42 && uiState == "begin") { uiState = "text2"; UIcanvas.setInstructions("Now for the results"); } else if (openTimer < 38 && uiState == "text2") { uiState = "text3"; UIcanvas.setInstructions("The winner is..."); } else if (openTimer < 34 && uiState == "text3") { uiState = "text4"; UIcanvas.setInstructions("Player " + winner + " with " + maxScore + " gold!"); } else if (openTimer < 30 && uiState == "text4") { UIcanvas.showClosingResults(ScoreBehavior.PlayerScores[0], ScoreBehavior.PlayerScores[1], ScoreBehavior.PlayerScores[2], ScoreBehavior.PlayerScores[3]); isCutscene = false; foreach (GameObject player in players) { //player.GetComponent<PlayerController>().lightning.enabled = false; player.GetComponent <PlayerController>().enabled = true; } uiState = "gameplay"; UIcanvas.startTimer(30f); sounds[0].Play(); } } if (UIcanvas.uiTimer <= 0 && !isClosing) { isClosing = true; uiState = "punish"; } if (isClosing) { closingTimer -= Time.deltaTime; } if (closingTimer < 0 && isClosing) { uiState = "nextLevel"; isClosing = false; Initiate.Fade("Main Menu", Color.black, 2f); sounds[0].Play(); } }