Question by
ishyla · Apr 23, 2016 at 04:51 PM ·
scene-loadingscene-switchingscene-changefadeoutfadein
Fade between scenes
Hi all, I have a JS script in which if a variable reaches 3, the next scene loads. How can I make the scene fade in instead of abruptly switching?
Here's my code:
#pragma strict
import UnityEngine.UI;
import UnityEngine.SceneManagement;
var theImage:UnityEngine.UI.Image;
var theSprite:Sprite; //The image you want to drag in the inspector
static var clickCount = 0;
function OnMouseDown () {
theImage.sprite = theSprite;
clickCount++;
Debug.Log(clickCount);
if (clickCount == 3){
loadLevel();
}
}
function Update () {
}
function loadLevel (){
SceneManager.LoadScene("Final");
}
Thanks!!
Comment
Your answer
Follow this Question
Related Questions
Animation Not Playing 0 Answers
Switching back and fourth between scenes help (script) 0 Answers
How to move to next scene using scene manager? 3 Answers
Why isn't my start screen loading? 0 Answers
When I load a scene a second time, some objects don't show up 0 Answers