Hello! I’ve created an empty scene to show the loading progress of my game. It contains only a gui Texture that changes basing the async.progress percentage. All works correctly but when the real game begins now it has very low fps (maybe 3-4 fps). Before i added this “loading scene” everything run smoothly. This is the code, am i forgetting something? Do i need to unload the loading scene somehow?
var async: AsyncOperation;
var progress : float;
var loading : Texture[];
var x : int;
function Start () {
async = Application.LoadLevelAsync("MyGame");
}
function Update() {
progress = async.progress;
if (progress < 0.2) {
x = 0;
}
if (progress > 0.2) {
x = 1;
}
if (progress > 0.4) {
x = 2;
}
if (progress > 0.6) {
x = 3;
}
if (progress > 0.8) {
x = 4;
}
if (progress > 0.9) {
x = 5;
}
}
function OnGUI() {
GUI.DrawTexture(Rect(100,100,100,100), loading[x]);
}