using QFramework; using QFramework.Example; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class TipItem : MonoBehaviour { UIDeviceTip tip; public string label; public void Set(string label) { this.label = label; } private void OnMouseEnter() { OnEnter(); } public void OnEnter() { tip = UIKit.GetPanel(); if (tip == null) { UIKit.OpenPanelAsync(UILevel.PopUI).ToAction().Start(this, () => { tip = UIKit.GetPanel(); tip.Set(label); tip.Active(true); }); } else { tip.Set(label); tip.Active(true); } } public void OnExit() { if (tip != null) { tip.Active(false); } } private void OnMouseExit() { OnExit(); } private void OnMouseUpAsButton() { if (tip != null) { tip.Active(false); } } }