工具栏修改
This commit is contained in:
1 parent
05e3d2f887
commit
5672898ce4
5 files changed
+235
-13
No files matched your search
@@ -9,6 +9,7 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.Events;
|
||||
using DG.Tweening;
|
||||
using System.Timers;
|
||||
using System.Collections;
|
||||
|
||||
namespace Assets.Scripts.UI.Control
|
||||
{
|
||||
@@ -31,7 +32,8 @@ namespace Assets.Scripts.UI.Control
|
||||
//private Texture2D cursor;
|
||||
private Outline outline;
|
||||
private Button mButton;
|
||||
|
||||
private Sequence se = null;
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
|
||||
@@ -120,7 +122,6 @@ namespace Assets.Scripts.UI.Control
|
||||
}
|
||||
}
|
||||
public bool showTooltip { get; set; }
|
||||
|
||||
private void BindEvent()
|
||||
{
|
||||
Timer timer = new Timer();
|
||||
@@ -128,8 +129,9 @@ namespace Assets.Scripts.UI.Control
|
||||
var group = tooltips.GetComponent<CanvasGroup>();
|
||||
timer.Elapsed += (r, s) =>
|
||||
{
|
||||
Debug.Log(131);
|
||||
timer.Stop();
|
||||
group.DOFade(1, 0.5f);
|
||||
|
||||
};
|
||||
|
||||
//鼠标进入
|
||||
@@ -144,9 +146,25 @@ namespace Assets.Scripts.UI.Control
|
||||
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
|
||||
{
|
||||
#endif
|
||||
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
|
||||
tooltips.SetActive(true);
|
||||
timer.Start();
|
||||
|
||||
//tooltips.SetActive(true);
|
||||
//tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||
|
||||
|
||||
//tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||
//DOTween.CompleteAll(true);
|
||||
se = DOTween.Sequence();
|
||||
se.SetDelay(1);
|
||||
se.AppendCallback(() =>
|
||||
{
|
||||
DOTween.CompleteAll(true);
|
||||
tooltips.SetActive(true);
|
||||
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
|
||||
tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||
});
|
||||
se.Play();
|
||||
//StartCoroutine(DelayShowTooltip());
|
||||
//timer.Start();
|
||||
}
|
||||
switch (mType)
|
||||
{
|
||||
@@ -183,6 +201,7 @@ namespace Assets.Scripts.UI.Control
|
||||
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
|
||||
{
|
||||
#endif
|
||||
DOTween.CompleteAll(true);
|
||||
group.DOFade(0, 1f).onComplete += () => {
|
||||
tooltips.SetActive(false);
|
||||
};
|
||||
@@ -215,6 +234,15 @@ namespace Assets.Scripts.UI.Control
|
||||
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerDown, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
||||
{
|
||||
if (!this.isActiveAndEnabled) return;
|
||||
DOTween.CompleteAll(true);
|
||||
tooltips.SetActive(false);
|
||||
//else
|
||||
//{
|
||||
// DOTween.CompleteAll(true);
|
||||
// tooltips.SetActive(true);
|
||||
// tooltips.GetComponent<CanvasGroup>().alpha = 0f;
|
||||
// tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||
//}
|
||||
switch (mType)
|
||||
{
|
||||
case Type.Normal:
|
||||
@@ -244,7 +272,7 @@ namespace Assets.Scripts.UI.Control
|
||||
{
|
||||
if (!this.isActiveAndEnabled) return;
|
||||
//Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
|
||||
|
||||
switch (mType)
|
||||
{
|
||||
case Type.Normal:
|
||||
@@ -275,7 +303,6 @@ namespace Assets.Scripts.UI.Control
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
public void SetEnabled(bool value)
|
||||
{
|
||||
base.enabled = value;
|
||||
|
||||
Reference in new issue
Block a user