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?
Script_1/Assets/TextBox.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
164 lines (130 sloc)
3.54 KB
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; | |
//YOU MUST USE THIS LINE TO GET ACCESS TO UI STUFF | |
using UnityEngine.UI; | |
using System.Collections; | |
public class TextBox : MonoBehaviour { | |
public float Str; | |
public string StrString; | |
public float Dex; | |
public string DexString; | |
public float Con; | |
public string ConString; | |
public float Int; | |
public string IntString; | |
public float Wis; | |
public string WisString; | |
public float Chr; | |
public string ChrString; | |
public int Damage; | |
public string MinDamageString; | |
public string MaxDamageString; | |
public int MinDamage; | |
public int MaxDamage; | |
public int HP; | |
public string HPString; | |
public int EnemyHP; | |
public int EnemyHPString; | |
public float Hit; | |
public string HitString; | |
public Text textRef; | |
private float ConValuef; | |
// Use this for initialization | |
void Start () { | |
Str = 0; | |
Dex = 0; | |
Con = 0; | |
Int = 0; | |
Wis = 0; | |
Chr = 0; | |
Damage = 0; | |
EnemyHP = 0; | |
Hit = 0; | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
//----------------------------Hit Points-------------------------------- | |
public void ClickTestHP(string text){ | |
Debug.Log (text); | |
HP = Random.Range (1, 8); //+ ((ConValuef *10)/100); | |
HPString = HP.ToString (); | |
textRef.text = HPString; | |
} | |
//----------------------------Attributes-------------------------------- | |
public void ClickTestStr(string text){ | |
Debug.Log (text); | |
Str = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
StrString = Str.ToString (); | |
textRef.text = StrString; | |
} | |
public void ClickTestDex(string text){ | |
Debug.Log (text); | |
Dex = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
DexString = Dex.ToString (); | |
textRef.text = DexString; | |
} | |
public void ClickTestCon(string text){ | |
Debug.Log (text); | |
Con = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
ConString = Con.ToString (); | |
textRef.text = ConString; | |
} | |
public void ClickTestInt(string text){ | |
Debug.Log (text); | |
Int = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
IntString = Int.ToString (); | |
textRef.text = IntString; | |
} | |
public void ClickTestWis(string text){ | |
Debug.Log (text); | |
Wis = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
WisString = Wis.ToString (); | |
textRef.text = WisString; | |
} | |
public void ClickTestChr(string text){ | |
Debug.Log (text); | |
Chr = Random.Range (1, 6) + Random.Range (1, 6) + Random.Range (1, 6); | |
ChrString = Chr.ToString (); | |
textRef.text = ChrString; | |
} | |
//----------------------------Damage---------------------------------- | |
//Minimum | |
public void MinDamageButtonDown(){ | |
MinDamage--; | |
MinDamageString = MinDamage.ToString (); | |
textRef.text = MinDamageString; | |
} | |
public void MinDamageButtonUp(){ | |
MinDamage++; | |
MinDamageString = MinDamage.ToString (); | |
textRef.text = MinDamageString; | |
} | |
//Maximum | |
public void MaxDamageButtonDown(){ | |
MaxDamage--; | |
MaxDamageString = MaxDamage.ToString (); | |
textRef.text = MaxDamageString; | |
} | |
public void MaxDamageButtonUp(){ | |
MaxDamage++; | |
MaxDamageString = MaxDamage.ToString (); | |
textRef.text = MaxDamageString; | |
} | |
//----------------------------Enemy---------------------------------- | |
public void ClickTestEnemyHP(string text){ | |
Debug.Log (text); | |
EnemyHP = Random.Range (1, 10); //+ ((ConValuef *10)/100); | |
HPString = HP.ToString (); | |
textRef.text = HPString; | |
} | |
//----------------------------Fight------------------------------- | |
public void Clicktest(string text){ | |
Debug.Log (text); | |
Hit = Mathf.Round (Random.Range (0f, 100f)); | |
HitString = Hit.ToString (); | |
textRef.text = HitString + "%"; | |
} | |
} | |
//percentToHit | |
//HitTrue | |
//if( |