DebugText.cs 309 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. public class DebugText : MonoBehaviour
  4. {
  5. public static DebugText ins;
  6. void Start()
  7. {
  8. ins = this;
  9. }
  10. void OnDestroy() {
  11. ins = null;
  12. }
  13. public void show(string text) {
  14. ins.GetComponent<Text>().text = text;
  15. }
  16. }