Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Intro_Scritping/DnD Project/Assets/RNG_Int.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
42 lines (35 sloc)
873 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |