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_Str.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
52 lines (39 sloc)
1011 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_Str : MonoBehaviour { | |
public Canvas GameCanvas; | |
public int StrValue = 0; | |
public int StrValue1 = 0; | |
public int StrValue2 = 0; | |
public int StrValue3 = 0; | |
public static string StrString; | |
Text updates; | |
void Awake() | |
{ | |
updates = GetComponent<Text>(); | |
StrString = "Str:"; | |
} | |
// Use this for initialization | |
public void Roll() | |
{ | |
//Strength Rolls | |
StrValue1 = Random.Range(1, 6); | |
StrValue2 = Random.Range(1, 6); | |
StrValue3 = Random.Range(1, 6); | |
StrValue = StrValue1 + StrValue2 + StrValue3; | |
//String Value | |
StrString = StrValue.ToString(); | |
Debug.Log(StrString); | |
} | |
public Text strText; | |
public void SetText(string text) | |
{ | |
strText.text = StrString; | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
updates.text = "Str: " + StrString; | |
} | |
} |