Skip to content
Permalink
19ad453044
Go to file
 
 
Cannot retrieve contributors at this time
42 lines (35 sloc) 873 Bytes
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;
}
}
You can’t perform that action at this time.