FileText.cs 517 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. using UnityEngine.UI;
  5. namespace TriLib.Samples
  6. {
  7. public class FileText : MonoBehaviour, ISelectHandler, IEventSystemHandler
  8. {
  9. public string Text
  10. {
  11. get
  12. {
  13. return base.GetComponent<Text>().text;
  14. }
  15. set
  16. {
  17. base.GetComponent<Text>().text = value;
  18. }
  19. }
  20. public ItemType ItemType { get; set; }
  21. public void OnSelect(BaseEventData eventData)
  22. {
  23. FileOpenDialog.Instance.HandleEvent(this.ItemType, this.Text);
  24. }
  25. }
  26. }