123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using EZXR.Glass.Core;
- using System.Collections;
- using System.Collections.Generic;
- using TMPro;
- using UnityEngine;
- namespace EZXR.Glass.UI
- {
- public class Toast : MonoBehaviour
- {
- //static Toast instance;
- //public static Toast Instance
- //{
- // get
- // {
- // if (instance == null)
- // {
- // instance = Instantiate(Resources.Load<Toast>("Toast"));
- // }
- // return instance;
- // }
- //}
- public TextMeshProUGUI content;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- public static void Show(string message)
- {
- Utilities.Android.SendIntent("ToSystem", "com.ezxr.glass.systemui", "Toast", message);
- //Instance.content.text = message;
- //Instance.gameObject.SetActive(true);
- //Instance.StopAllCoroutines();
- //Instance.StartCoroutine(Instance.WaitThenHide(duration));
- }
- //IEnumerator WaitThenHide(float duration)
- //{
- // yield return new WaitForSeconds(duration);
- // Instance.gameObject.SetActive(false);
- //}
- }
- }
|