2025-03-20 15:33:31 +08:00

58 lines
1.3 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using QFramework;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
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
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
}
protected override void OnOpen(IUIData uiData = null)
{
}
#if !VR
public void Update()
{
if (Point.gameObject.activeSelf)
{
Point.anchoredPosition = Utility.GetScreenPosByObj(transform as RectTransform);
}
}
#endif
public void Set(string txt)
{
Label.text = Regex.Replace(txt, @"\\n", "\n");
}
public void Active(bool active)
{
Point.gameObject.SetActive(active);
}
protected override void OnShow()
{
}
protected override void OnHide()
{
}
protected override void OnClose()
{
}
}
}