Compare commits

..

No commits in common. "926c3551b5496890c1ce0abb3eeda83455b9e606" and "49b678288c13178a328c35e47ffe4db98146fdbe" have entirely different histories.

8 changed files with 27 additions and 31 deletions

View File

@ -44,14 +44,14 @@ public class DeviceController : MonoSingleton<DeviceController>
} }
if (uitip != null) if (uitip != null)
{ {
uitip.Open(new UIDeviceTipData() { txt = deviceItem.tipItem.label }); uitip.Set(deviceItem.tipItem.label);
uitip.Show(); uitip.Active(true);
return; return;
} }
} }
else else
{ {
uitip?.Hide(); uitip?.Active(false);
} }
} }
@ -100,6 +100,10 @@ public class DeviceController : MonoSingleton<DeviceController>
{ {
#if !VR #if !VR
var uitip = UIKit.GetPanel<UIDeviceTip>(); var uitip = UIKit.GetPanel<UIDeviceTip>();
if (uitip != null)
{
uitip = UIKit.OpenPanel<UIDeviceTip>(UILevel.PopUI);
}
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit; RaycastHit hit;
if (Physics.Raycast(ray, out hit)) if (Physics.Raycast(ray, out hit))
@ -108,12 +112,12 @@ public class DeviceController : MonoSingleton<DeviceController>
if (uitip != null && deviceItem != null && deviceItem.tipItem != null && EventSystem.current.IsPointerOverGameObject() == false) if (uitip != null && deviceItem != null && deviceItem.tipItem != null && EventSystem.current.IsPointerOverGameObject() == false)
{ {
uitip.Open(new UIDeviceTipData() { txt = deviceItem.tipItem.label }); uitip.Set(deviceItem.tipItem.label);
uitip.Show(); uitip.Active(true);
return; return;
} }
} }
uitip?.Hide(); uitip?.Active(false);
#endif #endif
} }
public DeviceItem GetDeviceItem(string name) public DeviceItem GetDeviceItem(string name)

View File

@ -28,7 +28,7 @@ public class TipItem : MonoBehaviour
{ {
if (tip != null) if (tip != null)
{ {
tip.Hide(); tip.Active(false);
} }
} }
} }
@ -59,24 +59,22 @@ public class TipItem : MonoBehaviour
tip = UIKit.GetPanel<UIDeviceTip>(); tip = UIKit.GetPanel<UIDeviceTip>();
if (tip == null) if (tip == null)
{ {
UIKit.OpenPanelAsync<UIDeviceTip>(UILevel.PopUI).ToAction().StartGlobal(() => tip = UIKit.OpenPanel<UIDeviceTip>(UILevel.PopUI);
{
tip = UIKit.GetPanel<UIDeviceTip>(); tip.Set(label);
tip.Open(new UIDeviceTipData() { txt = label }); tip.Active(true);
tip.Show();
});
} }
else else
{ {
tip.Open(new UIDeviceTipData() { txt = label}); tip.Set(label);
tip.Show(); tip.Active(true);
} }
} }
public void OnExit() public void OnExit()
{ {
if (tip != null) if (tip != null)
{ {
tip.Hide(); tip.Active(false);
} }
} }
@ -89,7 +87,7 @@ public class TipItem : MonoBehaviour
{ {
if (tip != null) if (tip != null)
{ {
tip.Hide(); tip.Active(false);
} }
} }
} }

View File

@ -41,8 +41,6 @@ public class Launch : MonoBehaviour
}); });
yield return UIKit.OpenPanelAsync<UILoading>(); yield return UIKit.OpenPanelAsync<UILoading>();
yield return UIKit.OpenPanelAsync<UIDeviceTip>(canvasLevel: UILevel.PopUI);
UIKit.GetPanel<UIDeviceTip>().Hide();
yield return new WaitUntil(() => isLoadFinished == true); yield return new WaitUntil(() => isLoadFinished == true);
if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null) if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null)
{ {

View File

@ -8,7 +8,6 @@ namespace QFramework.Example
{ {
public class UIDeviceTipData : UIPanelData public class UIDeviceTipData : UIPanelData
{ {
public string txt;
} }
public partial class UIDeviceTip : UIPanel public partial class UIDeviceTip : UIPanel
{ {
@ -21,11 +20,6 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null) protected override void OnOpen(IUIData uiData = null)
{ {
if (uiData != null)
{
mData = uiData as UIDeviceTipData ?? new UIDeviceTipData();
Label.text = Regex.Replace(mData.txt, @"\\n", "\n");
}
} }
#if !VR #if !VR
@ -39,19 +33,21 @@ namespace QFramework.Example
} }
#endif #endif
//public void Active(bool active) public void Set(string txt)
//{ {
// Point.gameObject.SetActive(active); Label.text = Regex.Replace(txt, @"\\n", "\n");
//} }
public void Active(bool active)
{
Point.gameObject.SetActive(active);
}
protected override void OnShow() protected override void OnShow()
{ {
//Active(true);
} }
protected override void OnHide() protected override void OnHide()
{ {
//Active(false);
} }
protected override void OnClose() protected override void OnClose()