2024-12-14 18:27:59 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
using QFramework;
|
2025-02-08 11:12:50 +08:00
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
using System.Text.RegularExpressions;
|
2024-12-14 18:27:59 +08:00
|
|
|
|
|
|
|
|
namespace QFramework.Example
|
|
|
|
|
{
|
|
|
|
|
public class UIDeviceTipData : UIPanelData
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public partial class UIDeviceTip : UIPanel
|
|
|
|
|
{
|
|
|
|
|
protected override void OnInit(IUIData uiData = null)
|
|
|
|
|
{
|
|
|
|
|
mData = uiData as UIDeviceTipData ?? new UIDeviceTipData();
|
|
|
|
|
// please add init code here
|
2025-01-09 09:43:15 +08:00
|
|
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
2024-12-14 18:27:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnOpen(IUIData uiData = null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-20 15:33:31 +08:00
|
|
|
#if !VR
|
|
|
|
|
public void Update()
|
2024-12-14 18:27:59 +08:00
|
|
|
{
|
|
|
|
|
if (Point.gameObject.activeSelf)
|
|
|
|
|
{
|
|
|
|
|
Point.anchoredPosition = Utility.GetScreenPosByObj(transform as RectTransform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2025-03-20 15:33:31 +08:00
|
|
|
#endif
|
2024-12-14 18:27:59 +08:00
|
|
|
|
|
|
|
|
public void Set(string txt)
|
|
|
|
|
{
|
2025-02-08 11:12:50 +08:00
|
|
|
Label.text = Regex.Replace(txt, @"\\n", "\n");
|
2024-12-14 18:27:59 +08:00
|
|
|
}
|
|
|
|
|
public void Active(bool active)
|
|
|
|
|
{
|
|
|
|
|
Point.gameObject.SetActive(active);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnShow()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnHide()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnClose()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|