I have finished a Alpha build of our game. I have 20 scenes. I can load the scenes called: “Main Menu”, “Credits” and “Level” but I can’t load my normal levels. I attached a loading screen to load the normal levels. Now when i click my play button the different loadingscreen change all second and my level can’t get loaded.
The thing is this only happens when i play my .exe. When i run my game in Unity this all works perfect.
Here is my script for the loadingscreen:
#pragma strict
static var LoadingScreenON = true;
//Textures
var loadingscreen1 : Texture2D;
var loadingscreen2 : Texture2D;
var loadingscreen3 : Texture2D;
function Start ()
{
if (Loadingscreen.LoadingScreenON == true)
{
Loadingscreen.LoadingScreenON = false;
guiTexture.enabled = false;
}
}
function Update ()
{
if (Loadingscreen.LoadingScreenON == true)
{
RandomPic();
guiTexture.enabled = true;
guiTexture.pixelInset.x = 0;
guiTexture.pixelInset.y = 0;
guiTexture.pixelInset.width = Screen.width;
guiTexture.pixelInset.height = Screen.height;
}
}
function RandomPic()
{
var randPic = Random.Range(0, 2);
var chosenPicture = randPic;
switch (chosenPicture)
{
case 0:
guiTexture.texture = loadingscreen1;
break;
case 1:
guiTexture.texture = loadingscreen2;
break;
case 2:
guiTexture.texture = loadingscreen3;
break;
}
}
Do you know what I’m doing wrong ?
EDIT: I think the problem is the loadingscreen it just won’t disapear. How can I fix that ?
Where's your level loading code?
– tanoshimiI added the script. Sorry for that.
– GEWLAR