Search Unity

Progress bar script Load level :( [HELP]

Discussion in 'Scripting' started by NessimOnair, Sep 23, 2013.

  1. NessimOnair

    NessimOnair

    Joined:
    Jul 19, 2013
    Posts:
    22


    Hello sorry for my french :/ I followed a tutorial to create a progress bar are not my script to load a NIVAUX :/ I is not what to do or meter :/ I need your help called me the code to load the meter :/ level of games thank you youtube video:


    http://www.youtube.com/watch?v=-tmjnoe-dqI



    Code (csharp):
    1. var progress : float = 0;
    2. var pos : Vector2 = new Vector2(20,40);
    3. var size : Vector2 = new Vector2(60,20);
    4. var progressBarEmpty : Texture2D;
    5. var progressBarFull : Texture2D;
    6.  
    7.  function OnGUI()
    8. {
    9.     GUI.DrawTexture(Rect(pos.x, pos.y, size.x, size.y), progressBarEmpty);
    10.     GUI.DrawTexture(Rect(pos.x, pos.y, size.x * Mathf.Clamp01(progress), size.y), progressBarFull);
    11. }
    12.  
    13. function Update()
    14. {
    15.  
    16.     progress = Time.time * 0.05;
    17.        
    18.    
    19. }
    20.  

    HELP +1 :)


    source script : http://answers.unity3d.com/questions/7846/how-do-i-make-a-progress-bar.html