// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { levelchanger.FadeToNextLevel(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { levelChangerHandle.FadeToNextLevel(); } }
/** * What happesn when player enters the collider * * transitions to next level */ private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { m_LevelChanger.FadeToNextLevel(); } }
private void AddButton(Button prefab, SongData sd) { // Create Button Button button = Instantiate(prefab); button.name = sd.songName; // Create Label Text text = button.GetComponentInChildren <Text>(); if (text) { text.text = sd.songName; } // Add scene transition listener button.onClick.AddListener(() => { levelChanger.SetSong(sd); levelChanger.FadeToNextLevel(); }); // Put Under Menu in hierarchy RectTransform transform = button.GetComponent <RectTransform>(); transform.SetParent(GameObject.Find("Menu").transform, false); transform.anchoredPosition = position; position = position + (Vector2.down * spacing); }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { ScriptCalled.FadeToNextLevel(); } }
public void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player") { //Add Door collision here! // Debug.Log("doorhit"); sn.FadeToNextLevel(); } }
public void PlayGame() { levelChanger.FadeToNextLevel(); // souce.Play(); startArm.SetActive(true); optionArm.SetActive(false); QuitArm.SetActive(false); }
IEnumerator endNight() { yield return(new WaitForSeconds(4f)); levelChanger.FadeToNextLevel(); yield return(new WaitForSeconds(.75f)); player.SetActive(true); }
IEnumerator changeScenes() { yield return(new WaitForSeconds(2f)); levelChanger.FadeToNextLevel(); yield return(new WaitForSeconds(.7f)); player.GetComponent <PlayerController>().enabled = true; }
IEnumerator DriveToWork() { stats.gameObject.SetActive(false); carAnim.SetBool("ToSchool", true); yield return(new WaitForSeconds(2f)); levelChanger.FadeToNextLevel(); yield return(new WaitForSeconds(.75f)); stats.gameObject.SetActive(true); }
IEnumerator driveToSchool() { player.SetActive(false); carAnim.SetBool("ToSchool", true); yield return(new WaitForSeconds(2f)); levelChanger.FadeToNextLevel(); yield return(new WaitForSeconds(.75f)); player.SetActive(true); }
void Update() { if (healthBar.GetComponent <Scrollbar>().size == 0f) { ScriptCalled.FadeToLevel(1); } else if (healthBarEnnemie.GetComponent <Scrollbar>().size == 0f) { ScriptCalled.FadeToNextLevel(); } }
// Update is called once per frame void Update() { timer += Time.deltaTime; if (timer > 25 && !called) { //ring bell events levelChanger.FadeToNextLevel(); called = true; } }
public override void TriggerEvent() { if (CanTriggerEvent()) { levelChanger.FadeToNextLevel(); base.TriggerEvent(); } else { Debug.LogWarning($"Already triggered event {EventName}"); } }
public void ChangeScene() { if (timeNewScene >= 0) { timeNewScene -= Time.deltaTime; } else { //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); changer.FadeToNextLevel(); } }
// Update is called once per frame void Update() { if (displayTimeRemains > 0) { displayTimeRemains -= Time.deltaTime; if (displayTimeRemains <= 0) { levelCurtain.FadeToNextLevel(); enabled = false; } } }
// Update is called once per frame void Update() { if (Input.GetMouseButtonUp(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit Hit; if (Physics.Raycast(ray, out Hit)) { modelName = Hit.transform.name; switch (modelName) { case "0": levelchanger.FadeToNextLevel(); DontDestroyOnLoad(sphere1.gameObject); sphere1.transform.localPosition = new Vector3(0f, 0f, 0f); sphere1.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); break; case "1": levelchanger.FadeToNextLevel(); DontDestroyOnLoad(sphere2.gameObject); sphere2.transform.localPosition = new Vector3(0f, 0f, 0f); sphere2.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); break; case "2": levelchanger.FadeToNextLevel(); DontDestroyOnLoad(sphere3.gameObject); sphere3.transform.localPosition = new Vector3(0f, 0f, 0f); sphere3.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); break; default: break; } } } OrbitAround(); }
IEnumerator DriveAway() { player.SetActive(false); mom.SetActive(false); dad.SetActive(false); carAnim.SetBool("ToBeach", true); yield return(new WaitForSeconds(2f)); levelChanger.FadeToNextLevel(); yield return(new WaitForSeconds(.75f)); player.SetActive(true); }
private void OnTriggerEnter2D(Collider2D collision) { GameObject.Find("GameManager").GetComponent <GameManager>().actualShapeOnExit = GameObject.Find("Player").GetComponent <PlayerMovement>().actualShape; if (gameObject.name == "LevelChangeScene8a" || gameObject.name == "LevelChangeScene7a") { GameObject.Find("GameManager").GetComponent <GameManager>().is8A = true; } else if (gameObject.name == "LevelChangeScene8b" || gameObject.name == "LevelChangeScene7b") { GameObject.Find("GameManager").GetComponent <GameManager>().is8A = false; } lChanger.FadeToNextLevel(levelToLoad); }
// Update is called once per frame void Update() { timer += Time.deltaTime; if (timer >= TimeToChangeScene) { LC.FadeToNextLevel(); } transform.Translate(Vector3.right * Time.deltaTime * velocityRotation); target.Translate(Vector3.up * Time.deltaTime * velocityUp); transform.Translate(Vector3.up * Time.deltaTime * velocityUp); transform.Translate(Vector3.back * Time.deltaTime * velocityBack); transform.LookAt(target); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision == player) { if (SceneManager.GetActiveScene().name != "Level 2") { levelChanger.FadeToNextLevel(); } else { levelChanger.FadeToLevel(0); } } }
void MoveObject() { Vector3 aPos = gameObject.transform.position; Vector3 bPos = new Vector3(0, 0, 0); gameObject.transform.position = Vector3.Lerp(aPos, bPos, Time.deltaTime); waitForLerp -= Time.deltaTime; if (waitForLerp <= 0) { DontDestroyOnLoad(gameObject); levelchanger.FadeToNextLevel(); gameObject.GetComponent <Orbit>().enabled = false; } }
void UpdateTime() { if (time >= 0) { time -= Time.deltaTime; countdown.text = "Time: " + time.ToString("f0"); } else { status = arrived; } if (status.Equals(arrived)) { Debug.Log("Entrou Arrived"); //if (onLucioIsComing != null) { //onLucioIsComing(); shotCount -= Time.deltaTime; if (shotCount <= 0 && spawner != stop) { Vector3 position = new Vector3(-15f, Random.Range(-4.4f, 4.3f), -1f); Instantiate(shotVariantPrefab, position, Quaternion.identity); shotCount = 1f; } } if (lucioScore >= lucioLimit) { spawner = stop; if (spawnEnemies.numberOfEnemies == 0) { changeSceneTimer -= Time.deltaTime; if (changeSceneTimer <= 0) { changer.FadeToNextLevel(); } } } } }
public override void TriggerEvent() { if (CanTriggerEvent()) { workCount--; Debug.Log("Work done! Remaining: " + workCount); CanPress = false; GetComponentInChildren <Animator>().SetTrigger("Pressed"); if (workCount <= 0) { base.TriggerEvent(); stats.IncreaseStat(LifeStat.WEALTH); stats.GetComponent <SpriteRenderer>().enabled = true; levelChanger.FadeToNextLevel(); } } }
// Populate content panel with buttons assigned to scenes. private void PopulateButtons() { Debug.Log("scene count " + sceneCount); for (int i = 1; i < sceneCount; i++) { // instantiate a button per scene available in build (except menu scene). GameObject obj = Instantiate(levelButtonPrefab); // place button under content panel. obj.transform.SetParent(contentPanel.transform, false); Button button = obj.GetComponent <Button>(); int val = i; // select associated scene when button gets clicked. button.onClick.AddListener(delegate { selector.FadeToNextLevel(); }); // change button text to reflect level number. button.GetComponentInChildren <Text>().text = i.ToString(); } }
public void DisplayNextSentence() { if (sentences.Count == 0) { EndDialog(); //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); changer.FadeToNextLevel(); //Debug.Log("Vá para a próxima cena"); return; } Image sentence = sentences.Dequeue(); imageDialog.sprite = m_Sprite[i]; i++; //Debug.Log("DisplayNextSentence" + i); }
public void TriggerLevelLoad() { levelChangerHandle.FadeToNextLevel(); }
public void LevelComplete() { levelChanger.FadeToNextLevel(); }
public void restart() { levelchanger.FadeToNextLevel(); }