123456789101112131415161718192021222324252627282930313233343536373839 |
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class TextType : MonoBehaviour {
- Text text;
- public GameObject Player;
- public int playernumber;
- public int playerlife;
- public float playerspeed;
- public int playerbomb;
- // Use this for initialization
- void Start () {
- text = GetComponent<Text> ();
- playernumber = Player.GetComponent<PlayerController> ().playerNumber;
- }
-
- // Update is called once per frame
- void Update () {
- if (Player) {
- playerlife = Player.GetComponent<PlayerController> ().lifenum;
- playerspeed = Player.GetComponent<PlayerController> ().moveSpeed;
- playerbomb = Player.GetComponent<PlayerController> ().playerbomb-1;
- text.text = "Player"+playernumber.ToString() +"-Life:" + playerlife.ToString ()+"-Speed:"+ playerspeed.ToString() +
- "-BombLength:"+playerbomb.ToString();
- }
- else {
- playerlife = 0;
- text.text = "Player1-Life:" + playerlife.ToString ()+"-Speed"+ playerspeed.ToString() +
- "-BombLength"+playerbomb.ToString();
- }
-
-
- }
- public void Texttype(){
-
- }
- }
|