I need another set of eyes to figure out a problem. I have an error of:
NullReferenceException: Object reference not set to an instance of an object
The commented lines are where it happens:
private void DisplayMercAttributes(){
for(int cnt = 0; cnt < Enum.GetValues(typeof(MercenaryVariable)).Length; cnt++){
GUI.Label (new Rect(10, 70 + (cnt * LineHeight), 70, LineHeight), ((MercenaryVariable)cnt).ToString ());
//GUI.Label (new Rect(85, 70 + (cnt * LineHeight), 70, LineHeight), _protag.GetMercAttribute(cnt).AcceptedValue.ToString ());
}
private void DisplayPracAttributes(){
for(int cnt = 0; cnt < Enum.GetValues (typeof(PractitionerVariable)).Length; cnt++){
GUI.Label (new Rect(10, 70 + (cnt * LineHeight), 70, LineHeight), ((PractitionerVariable)cnt).ToString());
//GUI.Label (new Rect(85, 70 + (cnt * LineHeight), 70, LineHeight), _protag.GetPractAttribute(cnt).AcceptedValue.ToString());
}
The problem lies at _protag.GetMercAttribute(cnt) and _protag.GetPracAttribute(cnt). It shouldn’t happen because the other attributes are set up the same way and work. The only difference between those attributes and these ones are that they only have 1 thing in their enum list, while the others have multiple things.