DebudText.cs 478 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DebudText : MonoBehaviour {
  6. public Text text;
  7. public Joystick joystick;
  8. public SteeringWheel steeringWheel;
  9. // Use this for initialization
  10. public void Start(){
  11. text = GetComponent<Text> ();
  12. }
  13. public void Update(){
  14. if (joystick)
  15. text.text = joystick.value.ToString();
  16. if (steeringWheel)
  17. text.text = ((int)steeringWheel.angle).ToString();
  18. }
  19. }