ERROR Loading Script! WHAT'S WRONG??
Hello All,,
i'm a newbie in C# script
i have a problem here, i have download loading scripts it's works fine in original *.unitypackage File!, but it's always have an error, if the script i using it in my project. What's the problem??! i have checked the script manually and 'its same. No different at all. Can anybody help me? Thanks in advance (^-^)
here my scripts :
using UnityEngine;
using System.Collections;
public class LoadingAWScript : MonoBehaviour
{
public GUITexture LoadingTexture;
public Texture[] LoadingTextures;
private AsyncOperation loadscene;
private float StreamProgress = 0.0f;
// Use this for initialization
void Start ()
{
LoadingTexture.texture = LoadingTextures[0];
loadscene = Application.LoadLevelAsync("MainScene");
}
// Update is called once per frame
void Update ()
{
StreamProgress = loadscene.progress;
if ( StreamProgress <= 0.0f)
LoadingTexture.texture = LoadingTextures[0];
if ( StreamProgress > 0.0f && StreamProgress <= 0.1f)
LoadingTexture.texture = LoadingTextures[1];
if ( StreamProgress > 0.1f && StreamProgress <= 0.2f)
LoadingTexture.texture = LoadingTextures[2];
if ( StreamProgress > 0.2f && StreamProgress <= 0.3f)
LoadingTexture.texture = LoadingTextures[3];
if ( StreamProgress > 0.3f && StreamProgress <= 0.4f)
LoadingTexture.texture = LoadingTextures[4];
if ( StreamProgress > 0.4f && StreamProgress <= 0.5f)
LoadingTexture.texture = LoadingTextures[5];
if ( StreamProgress > 0.5f && StreamProgress <= 0.6f)
LoadingTexture.texture = LoadingTextures[6];
if ( StreamProgress > 0.6f && StreamProgress <= 0.7f)
LoadingTexture.texture = LoadingTextures[7];
if ( StreamProgress > 0.7f && StreamProgress <= 0.8f)
LoadingTexture.texture = LoadingTextures[8];
if ( StreamProgress > 0.8f && StreamProgress <= 0.9f)
LoadingTexture.texture = LoadingTextures[9];
if ( StreamProgress > 0.9f && StreamProgress <= 1.0f)
LoadingTexture.texture = LoadingTextures[10];
}
}
Answer by Jessespike · Sep 30, 2015 at 08:31 PM
Seems like it's trying to load a scene that doesn't exist. Do you have a scene called "MainScene" in your project?
Yes of course. i have scene "$$anonymous$$ainScene". but still have an error
Answer by KristianBalaj · Sep 30, 2015 at 08:28 PM
I think problem can be in that, that you do not have unity pro version because I think than async functions are enabled only in pro version of unity.
that's different Unity Free and pro for script feature??
I'm Using Unity 5 Free Version (T.T)
Yes of course .... i think that in free version you can not use async operations ... for scene loading try to use fading out and in or just load one Sprite "Loading" and Load scene. You can´t use moving loading scenes.
Version 5 and above contain all engine features including load scene async in the free and pro version
It does, I have it, use it, and it works just fine.
Your answer
Follow this Question
Related Questions
"The associated script cannot be loaded." 0 Answers
Unity Crashes When Clicking Play: Script Error? 1 Answer
Script errors 1 Answer
Object reference not set to an instance of an object - Jumping Scripts (C#) 1 Answer
Create a copy of a non MonoBehaviour class and set variables from other class 0 Answers