Code where things go wrong and errors
GUI.Label (new Rect(10,10,50,25),"Name:");
_toon.Name = GUI.TextArea(new Rect(65,10,100,25),_toon.Name);
for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++){
GUI.Label(new Rect(10,40(cnt + 25),100,25),((AttributeName)cnt).ToString());
GUI.Label(new Rect(115,40(cnt + 25f),30,25), _toon.GetPrimaryAttribute(cnt).AdjustedBaseValue);}
GUI.Button(new Rect(150,40,25,25),"+");
GUI.Button(new Rect(150,40,25,25),"-");
GUI.Label(new Rect(250,10,100,25),"Points left:" + pointsLeft.ToString());
What is it supposed to do
So what this supposed to do is takes all from the Enum of AttributeName and then align the labels so it looks good. and I get a tons of errors.
Well there are no errors on the other scripts the whole scripts of this (Refernce to how the “_toon” is defined)
Whole script
using UnityEngine;
using System.Collections;
using System;
public class CharacterGenerator : MonoBehaviour {
private PlayerChar _toon;
private const int exp = 350;
private const int min_att = 10;
private int pointsLeft;
// Use this for initialization
void Start () {
_toon = new PlayerChar();
_toon.Awake ();
for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++){
_toon.GetPrimaryAttribute(cnt).BaseValue = min_att;
pointsLeft = exp;
}
}
// Update is called once per frame
void Update () {
}
void OnGUI(){
//Remake this for necromancy
GUI.Label (new Rect(10,10,50,25),"Name:");
_toon.Name = GUI.TextArea(new Rect(65,10,100,25),_toon.Name);
for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++){
GUI.Label(new Rect(10,40(cnt + 25),100,25),((AttributeName)cnt).ToString());
GUI.Label(new Rect(115,40(cnt + 25f),30,25), _toon.GetPrimaryAttribute(cnt).AdjustedBaseValue);}
GUI.Button(new Rect(150,40,25,25),"+");
GUI.Button(new Rect(150,40,25,25),"-");
GUI.Label(new Rect(250,10,100,25),"Points left:" + pointsLeft.ToString());
}
}
the PlayChar is my character base which compiles without error too. Thus that shouldn’t be the problems.


