반응형
Notice
Recent Posts
Recent Comments
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

Do Something IT

[unity] loding Progress base logic 본문

Unity3D

[unity] loding Progress base logic

아낙시만더 2012. 10. 8. 10:54
반응형
Reference info : Application.GetStreamProgressForLeve
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Preloader :MonoBehaviour
{
    public GUISkin skin;
 
    void Update()
    {

        //Wait for both mainmenu&game scene to be loaded (since mainmenu doesnt check on game scene)
        if (Application.GetStreamProgressForLevel(1) >= 1 && Application.GetStreamProgressForLevel(2) >= 1)
            Application.LoadLevel(1);

    }

    void OnGUI()
    {
        GUI.skin = skin;

        GUI.Label(new Rect(Screen.width / 2 - 70, Screen.height / 2 - 12, 140, 25), "Loading: " + (int)(Application.GetStreamProgressForLevel(2) * 100)+"%");
    }

}
반응형
Comments