|
ok so debugged everything no errors unity still crashes cuz of my vitals part in my character generator script any ideas? private void DisplayVital(){ for(int cnt = 0; cnt < Enum.GetValues(typeof(VitalName)).Length; cnt++){ GUI.Label(new Rect(10, 40 + ((cnt + 7) * 25), 100, 25), ((VitalName)cnt).ToString()); GUI.Label(new Rect(115, 40 + ((cnt + 7) * 25), 30, 25), _toon.GetVital(cnt).AdjustedBaseValue.ToString()); }
(comments are locked)
|

You can probably narrow it down to one of those 5 functions called in OnGUI() by commenting out those lines and see which ones can cause a crash by themselves.
its my vitals function any advise?
can u help me out with a proper vitals function for unity 3.4?
Hmm, I don't see anything wrong with the GUI part of that code. I don't know anything about your implementation of the PlayerCharacter class, so I'm guessing it would be somewhere in there? I guess there could also be a problem with the enum VitalName, but I imagine the compiler would complain about that first. I'd double check that it is defined somewhere just to be safe though.
BTW, you can format the code by pressing the 101010 button, that will make it a bit easier to read. You should just highlight it and press the button.
i can post my playercharacter script mind taking a look see if something is wrong?