I have a list of attributes and want each of them to have 3 dice rolls. Right now, I can only figure out how to get 3 dice rolls overall.
for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++){
GUI.Label (new Rect(10, 95 + (cnt * LineHeight), 70, LineHeight), ((AttributeName)cnt).ToString ());
GUI.Label (new Rect(85, 95 + (cnt * LineHeight), 30, LineHeight), _protag.GetPrimaryAttribute(cnt).AcceptedValue.ToString ());
if(rollsLeft == 3){
if(GUI.Button (new Rect(125, 95 + (cnt * LineHeight), 40, LineHeight), "Die")){
dRoll1 = ((int)(UnityEngine.Random.Range(1.0f, 20.0f)));
_protag.GetPrimaryAttribute(cnt).BaseValue = dRoll1;
rollsLeft--;}
Debug.Log (dRoll1.ToString());
}
if(rollsLeft == 2){
if(GUI.Button (new Rect(125, 95 + (cnt * LineHeight), 40, LineHeight), "Do")){
dRoll2 = ((int)(UnityEngine.Random.Range(1.0f, 20.0f)));
rollsLeft--;
Debug.Log (dRoll2.ToString());
if(dRoll2 > dRoll1){
_protag.GetPrimaryAttribute(cnt).BaseValue = dRoll2;
}
}}
if(rollsLeft == 1){
if(GUI.Button (new Rect(125, 95 + (cnt * LineHeight), 40, LineHeight), "Dee")){
dRoll3 = ((int)(UnityEngine.Random.Range(1.0f, 20.0f)));
rollsLeft--;
Debug.Log (dRoll3.ToString());
if(dRoll3 > dRoll2 && dRoll3 > dRoll1){
_protag.GetPrimaryAttribute(cnt).BaseValue = dRoll3;
}
}}
if(rollsLeft < 1){
if(GUI.Button (new Rect(125, 95 + (cnt * LineHeight), 40, LineHeight), "Doh")){
}
}
}