コード例 #1
0
 //-----------UpdateResults()-------------
 // Update result visually in UI
 //-------------------------------
 public void UpdateResults(DiceTypes diceType, int result)
 {
     ThrowResults.Add(result);
     if (ResultCounter != null)
     {
         count++;
         ResultCounter.text += diceType.ToString() + " Rolled: " + result + "\n";
         RectTransform _rectObject = ResultCounter.GetComponent <RectTransform> ();
         _rectObject.sizeDelta = new Vector2(_rectObject.sizeDelta.x, 50.05f + (15 * count));
     }
     else
     {
         Debug.LogWarning("There's no UI text object attached to the tablescipt, results will not be shown");
     }
 }