Permalink
Cannot retrieve contributors at this time
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class RNG_Cha : MonoBehaviour { | |
//Base Values | |
public int ChaValue = 0; | |
public int ChaValue1 = 0; | |
public int ChaValue2 = 0; | |
public int ChaValue3 = 0; | |
public static string ChaString; | |
Text updates; | |
void Awake() | |
{ | |
updates = GetComponent<Text>(); | |
ChaString = "Cha:"; | |
} | |
// Use this for initialization | |
public void Roll() | |
{ | |
//Rolls | |
ChaValue1 = Random.Range(1, 6); | |
ChaValue2 = Random.Range(1, 6); | |
ChaValue3 = Random.Range(1, 6); | |
ChaValue = ChaValue1 + ChaValue2 + ChaValue3; | |
//String Value | |
ChaString = ChaValue.ToString(); | |
Debug.Log(ChaString); | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
updates.text = "Cha: " + ChaString; | |
} | |
} |