//function which executes on scene awake before the start function void Awake() { //find the ImageLS gameobject from the Hierarchy loadingScreenImage = GameObject.Find("ImageLS"); instance = this; instance.loadingScreenImage.SetActive(true); }
//function which executes on scene awake before the start function void Awake() { //find the ImageLS gameobject from the Hierarchy // loadingScreenImage = GameObject.Find("ImageLS"); //destroy the already existing instance, if any if (instance) { Destroy(gameObject); hide(); //call hide function to hide the 'loading Screen Sprite' return; } instance = this; instance.loadingScreenImage.SetActive(false); DontDestroyOnLoad(this); //make this object persistent between scenes }
// Update is called once per frame void Update() { updateScreenSize(); if (currentIndex < numberOFFrameInCutscene) { //Debug.Log(Time.time); } else if (nextScene.Equals("none")) { Application.Quit(); } else { LoadingScreen46.show(); Application.LoadLevel(nextScene); } if (Input.GetKeyDown(KeyCode.Escape)) { LoadingScreen46.show(); Application.LoadLevel(nextScene); } }