Hi all. Theres a way to load my screen one time on menu screen and keep this screen loaded on memory, cache, or something, and when click on play the screen is already loaded, and if the player exits to menu and play again, dont need to load anymore.
You can use LoadLevelAdditiveAsync and just have the level begin 'inactive' or far away from the main action where the player can't see it; when they click 'play', everything gets activated.
Perhaps this answer could help you http://answers.unity3d.com/questions/189328/caching-a-scene-before-loading-additively.html
I try to make this code, but when click on start button my scene "fase1" dont appear. can anyone help me. and it seems the AsyncOperation never reach the isDone status. my "loadingPanel" never set active to false... using UnityEngine; using UnityEngine.UI; using System.Collections; public class MenuScript : MonoBehaviour { public GameObject creditsPanel; public AudioSource btnClick; public AudioSource bgMusic; public SpriteRenderer sndButton; public Sprite soundOn; public Sprite soundOff; public GameObject loadingPanel; public Slider slider; private AsyncOperation loadingOp = null; int soundOption; void Start() { StartCoroutine (LoadScene()); soundOption = PlayerPrefs.GetInt ("sound", 1); SoundController (); } IEnumerator LoadScene(){ loadingOp = Application.LoadLevelAsync ("fase1"); loadingOp.allowSceneActivation = false; yield return loadingOp; } // Update is called once per frame void Update () { if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint((Input.GetTouch(0).position)), Vector2.zero); if (hit.collider != null) { btnClick.Play (); if (hit.collider.tag == "Play") { if (loadingOp.isDone) { //old code - load the level evertime when back to menu //loadingOp = Application.LoadLevelAsync("fase1"); loadingOp.allowSceneActivation = true; } } else if (hit.collider.tag == "Credits") { creditsPanel.SetActive(true); } else if (hit.collider.tag == "Quit") { Application.Quit(); } else if (hit.collider.tag == "Sound") { if (soundOption == 1) { soundOption = 0; } else { soundOption = 1; } SoundController(); PlayerPrefs.SetInt("sound", soundOption); } } } if (loadingOp != null) { if (loadingOp.isDone) { loadingPanel.SetActive(false); } else{ loadingPanel.SetActive(true); slider.value = loadingOp.progress; } } } public void btnBack(){ btnClick.Play (); creditsPanel.SetActive (false); } void SoundController(){ if (soundOption == 1) { bgMusic.Play(); btnClick.volume = 1; sndButton.sprite = soundOn; } else { bgMusic.Stop(); btnClick.volume = 0; sndButton.sprite = soundOff; } } }