骑行界面优化&PCtips显示调整
This commit is contained in:
1 parent
d91dc17ea7
commit
2743c8d185
23 files changed
+1368
-769
No files matched your search
@@ -8,6 +8,7 @@ using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Events;
|
||||
using DG.Tweening;
|
||||
using System.Timers;
|
||||
|
||||
namespace Assets.Scripts.UI.Control
|
||||
{
|
||||
@@ -109,8 +110,18 @@ namespace Assets.Scripts.UI.Control
|
||||
}
|
||||
}
|
||||
public bool showTooltip { get; set; }
|
||||
|
||||
private void BindEvent()
|
||||
{
|
||||
Timer timer = new Timer();
|
||||
timer.Interval = 1000;
|
||||
var group = tooltips.GetComponent<CanvasGroup>();
|
||||
timer.Elapsed += (r, s) =>
|
||||
{
|
||||
timer.Stop();
|
||||
group.DOFade(1, 0.5f);
|
||||
};
|
||||
|
||||
//鼠标进入
|
||||
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerEnter, new UnityEngine.Events.UnityAction<UnityEngine.EventSystems.BaseEventData>(e =>
|
||||
{
|
||||
@@ -125,7 +136,7 @@ namespace Assets.Scripts.UI.Control
|
||||
#endif
|
||||
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
|
||||
tooltips.SetActive(true);
|
||||
tooltips.GetComponent<CanvasGroup>().DOFade(1f, 0.2f);
|
||||
timer.Start();
|
||||
}
|
||||
switch (mType)
|
||||
{
|
||||
@@ -154,14 +165,17 @@ namespace Assets.Scripts.UI.Control
|
||||
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerExit, new UnityAction<BaseEventData>(e =>
|
||||
{
|
||||
if (!this.isActiveAndEnabled) return;
|
||||
timer.Stop();
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
if (!string.IsNullOrWhiteSpace(Tooltips))
|
||||
{
|
||||
#else
|
||||
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
|
||||
{
|
||||
#endif
|
||||
tooltips.SetActive(false);
|
||||
#endif
|
||||
group.DOFade(0, 1f).onComplete += () => {
|
||||
tooltips.SetActive(false);
|
||||
};
|
||||
}
|
||||
//Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
switch (mType)
|
||||
|
||||
Reference in new issue
Block a user