Thank you very much. But now i have second problem. I have texture and when curexp + texture + and when you have level 20 texture exceeds my computer screen. And i need texture that increases ranging from 10 to 800. Perhaps you understand.
For understand: texture start in 20 resolution screen and end in 800 resolution screen.
Exp bar script texture
var curExp : float;
var maxExp : float;
var level : float = 1;
var expTexture : Texture;
function Update ()
{
if (curExp >= maxExp)
{
// It means we have leveled up
print ("LevelUp" + level);
curExp = 0;
LevelUp();
}
curExp += 10;
}
function OnGUI()
{
GUI.DrawTexture(Rect(300, 500, curExp, 30), expTexture);
}
function LevelUp()
{
// Increase our max exp
maxExp += 20;
level ++;
}