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_Cha.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
41 lines (34 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_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; | |
} | |
} |