ArrowDebugView.cs 620 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class ArrowDebugView : MonoBehaviour
  6. {
  7. public Text text;
  8. public GameObject panel;
  9. public Button tap;
  10. public static ArrowDebugView ins;
  11. public void AppendLog(string str) {
  12. text.text += str + "\n";
  13. }
  14. public void ClearLog() {
  15. text.text = "";
  16. }
  17. void Start() {
  18. ins = this;
  19. tap.onClick.AddListener(delegate() {
  20. panel.SetActive(!panel.activeSelf);
  21. });
  22. }
  23. void OnDestroy() {
  24. if (ins == this) ins = null;
  25. }
  26. }