public void Transition(string nextScene) { // Update player's destination. pc.destination = nextScene; // Check if the destination is a "night scene." // If yes, use loadingscreennight. Else, -day. bool temp = false; foreach (string scene in nightscenes) { if (pc.destination.Equals(scene)) { temp = true; } } if (temp) { gm.lastSceneName = "loadingscreennight"; sf.EndScene("loadingscreennight"); } else { gm.lastSceneName = "loadingscreenday"; sf.EndScene("loadingscreenday"); } }
void Update() { if (isDoor && insideArea && playerController.grounded && Input.GetButtonDown("Jump")) { playerController.freeze = true; if (isDoor) { audioSource.PlayOneShot(doorSound); } isDoor = false; screenFader.EndScene(sceneToLoad); } }
void Update() { if (levelName != "" && CheckDistance()) { // Player cannot interact with other things while walking through Door. if (Input.GetKeyDown(KeyCode.Space) && !pc.frozen) { // Door sound effect. if (GetComponent <AudioSource>() != null) { GetComponent <AudioSource>().Play(); } // Update lastSceneName and player's new destination; fade out for transition. gm.lastSceneName = gm.currentSceneName; pc.destination = levelName; if (transition) { tc.Transition(pc.destination); } else { sf.EndScene(pc.destination); } } } }
// Update is called once per frame void Update() { if (CheckFinishingLevel()) { screen_fader.EndScene(0); } }
public void LearnGame() { print("clicked 3"); print("clicked 3.1"); _fadeScr = GameObject.FindObjectOfType <ScreenFader>(); _fadeScr.EndScene(4); }
IEnumerator Wait(string destination) { yield return(new WaitForSeconds(4)); sf.EndScene(pc.destination); pc.isTransition = false; }
public void Exit() { print("retire"); Time.timeScale = 1; Camera.main.GetComponent <Pause>().PauseMenu.SetActive(false); Destroy(this.gameObject); _fadeScr.EndScene(2); }
public void gameEnd() { monsterHandle.playEnding(); platformHandle.SetBool("platformOpen", true); screenFaderHandle.EndScene(SceneManager.GetActiveScene().buildIndex, 2.0f); mainLightHandle.doom = true; scoreTextHandle.paused = true; }
public void NewGame() { print("clicked 1"); GameStatus = 4; print("clicked 1.1"); _fadeScr = GameObject.FindObjectOfType <ScreenFader>(); _fadeScr.EndScene(3); }
public void LoadGame() { print("clicked 2"); GameStatus = 3; print("clicked 2.1"); _fadeScr = GameObject.FindObjectOfType <ScreenFader>(); _fadeScr.EndScene(3); }
public void end() { GlobalStateController gsc = GameObject.Find("GlobalState(Clone)").GetComponent <GlobalStateController> (); gsc.setLevel(gsc.getLevel() + 1); ScreenFader sf = FindObjectOfType <ScreenFader> (); sf.EndScene(0, true); }
// Update is called once per frame void OnTriggerEnter2D(Collider2D other) { if (other.name == "player") { PlayerPrefs.SetInt("health", other.GetComponent <Player>().curHealth); other.GetComponent <Player>().panelText = other.GetComponent <Player>().textPanel.GetComponent <Text>().text; player.GetComponent <Player>().SetMove(false); fadeScr.EndScene(SceneNumber); } }
public void StartNewGame() { PlayerPrefs.SetInt("health", 100); PlayerPrefs.SetInt("attempts", 3); System.Random rnd = new System.Random(); int[] skills = new int[] { System.Convert.ToInt32(scienceSkill.text), System.Convert.ToInt32(trapsSkill.text), System.Convert.ToInt32(pilotingSkill.text), System.Convert.ToInt32(lungsSkill.text) }; int sum = skills[0] + skills[1] + skills[2] + skills[3]; Debug.Log(sum); if (skills[3] < 15) { PlayerPrefs.SetInt("professor", 2); } else if (skills[2] < 15) { PlayerPrefs.SetInt("professor", 1); } else if (skills[1] < 15) { PlayerPrefs.SetInt("professor", 0); } else if (sum < 60) { PlayerPrefs.SetInt("professor", 2); } else if (sum < 110) { PlayerPrefs.SetInt("professor", 1); } else { PlayerPrefs.SetInt("professor", 0); } PlayerPrefs.SetInt("survivalRate", System.Convert.ToInt32(survSkill.text)); PlayerPrefs.Save(); fadeScr.EndScene(2); }
public void Interact() { GlobalStateController gsc = GameObject.Find("GlobalState(Clone)").GetComponent <GlobalStateController> (); if (gsc.getLevel() == 1) { gsc.setLevel(gsc.getLevel() + 1); ScreenFader sf = FindObjectOfType <ScreenFader> (); sf.EndScene(0, false); } }
public void Continue() { try { System.IO.Directory.CreateDirectory(Application.dataPath + "/saves/"); // if there's not actorA save game, show the tutorial if (Directory.GetFiles(Application.dataPath + "/saves/", "*.bin").Length == 0) { _fadeScr.EndScene(1); } // else just skip it and load the main menu else { _fadeScr.EndScene(2); } } catch (Exception e) { Application.Quit(); } }
/// <summary> /// CheckVisibleTargets() checks every Transform gameObject returned by FindVisibleTargets() and checks its Tag. /// If player is found, the level resets. If an enemy corpse is found, alert mode is activated. /// </summary> public void CheckVisibleTargets() { if (enemy_manager.god_mode == true) //Don't check visible characters if god mode is activated. { return; } foreach (Transform t in visible_targets) { // Response for players! if (t.tag.Equals(Tags.player)) { if (t.GetComponent <Invisible>().IsInvisible()) { continue; } if (!player_found) { player_found = true; main_camera.MoveCameraTo(transform.position); screen_fader.EndScene(0); // Debug part //--------------------------- // Tint yellow the enemy who discovered a character GetComponent <MeshRenderer>().material.SetColor("_Color", new Color(1.0f, 1.0f, 0.0f, 0.0f)); //--------------------------- } } if (!enemy_manager.IsElementAlreadyIdentify(t.gameObject)) { // Response: If something is found, the enemy will move // to a near position to cleary identify that element if ((t.tag.Equals(Tags.corpse) || t.tag.Equals(Tags.portal)) && !IsElementIdentificationPending(t.gameObject)) { pending_identification_elements.Enqueue(t.gameObject); RhandorController rhandor = GetComponent <RhandorController>(); last_spotted_position.LastPosition = t.transform.position; rhandor.ChangeStateTo(rhandor.spotted_state); } } } }
public void Move() { anim.SetTrigger("walk down"); GameObject door = GameObject.Find("Door"); if (this.transform.position.x < door.transform.position.x) { transform.Translate(speed, -speed, 0); } else if (this.transform.position.y > door.transform.position.y) { transform.Translate(0, -speed, 0); } if (Vector2.Distance(this.transform.position, door.transform.position) < .3f) { ScreenFader sf = GameObject.Find("GameManager").GetComponent <ScreenFader>(); sf.EndScene("party"); } }
void Start() { sf.EndScene("loadingscreennight"); }
private void SplashScreenDone() { screenFader.EndScene(levelToLoad); }
public void Continue() { if (Index == 1) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info1.enabled = false; } if (Index == 2) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info2.enabled = false; } if (Index == 3) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info3.enabled = false; } if (Index == 4) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info4.enabled = false; } if (Index == 5) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info5.enabled = false; } if (Index == 6) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info6.enabled = false; } if (Index == 7) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info7.enabled = false; } if (Index == 8) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info8.enabled = false; } if (Index == 9) { Cont.enabled = false; Btn.GetComponent <Button>().enabled = false; Info9.enabled = false; } Index += 1; Btn.GetComponent <Button>().enabled = false; if (Index == 10) { _fadeScr.EndScene(_sceneNumb); } }
public void PlayGame() { sf.EndScene(SceneManager.GetActiveScene().buildIndex + 1); }
void Quit() { Close(); sf.EndScene("mainmenu"); }
public IEnumerator fadeScreen(float t) { yield return(new WaitForSeconds(t)); screenFader.EndScene(6); }
public void RestartGame() { screenFader.EndScene("Game3"); StartCoroutine(FadeSoundOut(0.5f)); }