#pragma strict
public class Attributes extends BaseStat {
public function Attribute() {
SetExpToLevel(50);
SetLevelModifier(1.05);
}
}
//List of attributes in Game
public enum AttributeName {
Might,
Constitution,
Nimbleness,
Speed,
Concentration,
Willpower,
Charisma
}
//then i want to get the gui function to return trough the for loop Might, Constitution, ect how can i achieve this on javescript???
function OnGUI() {
GUI.Label(Rect(10,10,50,25),"Name: ");
_toon._name = GUI.TextArea(Rect(65,10,100,25),_toon._name);
for(var cnt : int = 0; cnt < Enum.GetValues(AttributeName).Length; cnt++) {
GUI.Label(Rect(10,40 + (cnt * 25),100,25), Enum.GetValues(AttributeName.ToString()));
GUI.Label(Rect(115,40 + (cnt * 25),30,25),_toon.GetPrimaryAttribute(cnt).AdjustedBaseValue.ToString());
}
}
heres a video tutorial how to do it in c# but i dont know how to translate it ![]()
help me
dont forget to mark as answered.. today I fought with same problem and this worked for me.. thank you
– cupssterThis answered the same question for me.
– aviose