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