Ok, I have been following tutorial on leveling system, and I have some errors. Error line 22: Unexpected Symbol ‘}’. Line 34: Parsing Error. Here is script:
using UnityEngine;
using System.Collections;
public class PlayerLevelSystem : MonoBehaviour {
private int curLevel = 1;
private int maxLevel;
private int curExp = 0;
private int maxExp = 100;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if(curExp >= maxExp)
}
curExp=100;
curLevel++;
using UnityEngine;
using System.Collections;
public class PlayerLevelSystem : MonoBehaviour {
private int curLevel = 1;
private int maxLevel;
private int curExp = 0;
private int maxExp = 100;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if(curExp >= maxExp) {
curExp=100;
curLevel++;
}
}
void OnGUI()
{
GUILayout.BeginArea(new Rect(20,50,40,20), curexp + "/" + maxExp);
GUILayout.BeginArea(new Rect(20,50,40,20), "Level:" + curLevel);
}
}
Ok, the script worked, but it seems to be throwing at me no GUI. The EXP text shows, but no GUI, and level isn’t even there. could you show me what I am doing wrong?