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)
{
uitip.Open(new UIDeviceTipData() { txt = deviceItem.tipItem.label });
uitip.Show();
uitip.Set(deviceItem.tipItem.label);
uitip.Active(true);
return;
}
}
else
{
uitip?.Hide();
uitip?.Active(false);
}
}
@ -100,6 +100,10 @@ public class DeviceController : MonoSingleton<DeviceController>
{
#if !VR
var uitip = UIKit.GetPanel<UIDeviceTip>();
if (uitip != null)
{
uitip = UIKit.OpenPanel<UIDeviceTip>(UILevel.PopUI);
}
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit 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)
{
uitip.Open(new UIDeviceTipData() { txt = deviceItem.tipItem.label });
uitip.Show();
uitip.Set(deviceItem.tipItem.label);
uitip.Active(true);
return;
}
}
uitip?.Hide();
uitip?.Active(false);
#endif
}
public DeviceItem GetDeviceItem(string name)

View File

@ -28,7 +28,7 @@ public class TipItem : MonoBehaviour
{
if (tip != null)
{
tip.Hide();
tip.Active(false);
}
}
}
@ -59,24 +59,22 @@ public class TipItem : MonoBehaviour
tip = UIKit.GetPanel<UIDeviceTip>();
if (tip == null)
{
UIKit.OpenPanelAsync<UIDeviceTip>(UILevel.PopUI).ToAction().StartGlobal(() =>
{
tip = UIKit.GetPanel<UIDeviceTip>();
tip.Open(new UIDeviceTipData() { txt = label });
tip.Show();
});
tip = UIKit.OpenPanel<UIDeviceTip>(UILevel.PopUI);
tip.Set(label);
tip.Active(true);
}
else
{
tip.Open(new UIDeviceTipData() { txt = label});
tip.Show();
tip.Set(label);
tip.Active(true);
}
}
public void OnExit()
{
if (tip != null)
{
tip.Hide();
tip.Active(false);
}
}
@ -89,7 +87,7 @@ public class TipItem : MonoBehaviour
{
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<UIDeviceTip>(canvasLevel: UILevel.PopUI);
UIKit.GetPanel<UIDeviceTip>().Hide();
yield return new WaitUntil(() => isLoadFinished == true);
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 string txt;
}
public partial class UIDeviceTip : UIPanel
{
@ -21,11 +20,6 @@ namespace QFramework.Example
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
@ -39,19 +33,21 @@ namespace QFramework.Example
}
#endif
//public void Active(bool active)
//{
// Point.gameObject.SetActive(active);
//}
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()
{
//Active(true);
}
protected override void OnHide()
{
//Active(false);
}
protected override void OnClose()