Expected. Insert a semicolon at the end (UCE0001) (28262)

I try to build this script.
But an error occured.
How can I solve this???


var percent: float;

var ProcessBar:Texture2D;

var Title:Texture2D;

var Process:float = 0;

function OnGUI(){

  var width;

  var height;	

  width = Title.width;

  height = Title.height;

  GUI.BeginGroup(new Rect((Screen.width-width)/2,200,width,height));

  GUI.DrawTexture(Rect(0,0,width,height),Title);

  GUI.EndGroup();

  width = ProcessBar.width;

  height = ProcessBar.height;

  GUI.BeginGroup(new Rect((Screen.width - width )/2,400,width,height));

  GUI.DrawTexture(Rect(0,0,width,height),ProcessBar);

  Color temp = GUI.color;     // ';'expected. Insert a semicolon at the 
end. (UCE0001)

  GUI.color = Color.white;

  if( Process < width )

  {

    Process ++;

    GUI.Box(Rect(Process , 0 , width - Process , height) , "");

  }

  GUI.color = temp;

  GUI.EndGroup();

}

3 Answers

3

You just have to replace the "Color temp" with "var temp". You can (but you don't have to) append " : Color".

Like this:

var percent: float;
var ProcessBar:Texture2D;
var Title:Texture2D;
var Process:float = 0;

function OnGUI(){

    var width;
    var height;

    width = Title.width;
    height = Title.height;

    GUI.BeginGroup(new Rect((Screen.width-width)/2,200,width,height));
    GUI.DrawTexture(Rect(0,0,width,height),Title);
    GUI.EndGroup();
    width = ProcessBar.width;
    height = ProcessBar.height;
    GUI.BeginGroup(new Rect((Screen.width - width )/2,400,width,height));
    GUI.DrawTexture(Rect(0,0,width,height),ProcessBar);
    var temp : Color = GUI.color; // ';'expected. Insert a semicolon at the end. (UCE0001)
    GUI.color = Color.white;

    if( Process < width ){
        Process ++;
        GUI.Box(Rect(Process , 0 , width - Process , height) , "");
    }

    GUI.color = temp;
    GUI.EndGroup();
}

Thank you very much.

It works very well.

Best.

so... why don't you press the "correct answer" button? Or even tumbs up? Would be awesome...

Jung, you should select his answer as the proper answer to give him credit for helping you out. :)

Thank you.
It works very well.