// Use this for initialization
void Start()
{
if (mode == DisplayMode.Colors)
{
background = new Texture2D(1, 1);
background.SetPixel(1, 1, colors.background);
background.wrapMode = TextureWrapMode.Repeat;
background.Apply();
foreground = new Texture2D(1, 1);
foreground.SetPixel(1, 1, colors.foreground);
foreground.wrapMode = TextureWrapMode.Repeat;
foreground.Apply();
xpShadow = new Texture2D(1, 1);
xpShadow.SetPixel(1, 1, colors.xpShadowIncrease);
xpShadow.wrapMode = TextureWrapMode.Repeat;
xpShadow.Apply();
}
else
{
background = textures.background;
foreground = textures.foreground;
xpShadow = textures.xpShadowIncrease;
}
barwidth = Screen.width * screenPer;
boxwidth = barwidth / 10;
barstrt = Screen.width * ((1.0f - screenPer) / 2);
Debug.Log(barstrt + ":" + Screen.width);
parser.Load(IniFiles.XP);
if (parser.Get("XP").Equals(""))
{
parser.Set("", "XP", "0");
float curxp = 0;
for (int i = 0; i < 200; i++)
{
if (i != 0)
{
curxp += 800 + (400 * (i - 1));
}
int cp = Mathf.CeilToInt(curxp);
parser.Set("Ranks", "level-" + i, curxp.ToString());
}
curxp = 9999999;
parser.Set("Ranks", "level-200", curxp.ToString());
parser.Save(IniFiles.XP);
}
localxp = int.Parse(parser.Get("XP"));
calc();
}