改动与优化
This commit is contained in:
@@ -69,6 +69,7 @@ public class mailSlotPrefab : MonoBehaviour
|
||||
}
|
||||
|
||||
GameObject go = Instantiate(rewardPreviewPrefab, rewardPreviewRoot);
|
||||
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.14f, 0.01f, true);
|
||||
Image icon = go.GetComponent<Image>();
|
||||
if (icon == null)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using DG.Tweening;
|
||||
|
||||
public class rewardSlotPrefab : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
@@ -77,11 +78,40 @@ public class rewardSlotPrefab : MonoBehaviour, IPointerEnterHandler, IPointerExi
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
if (detailBtm != null) detailBtm.SetActive(true);
|
||||
if (detailBtm == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
detailBtm.SetActive(true);
|
||||
UI_OrderedEntryAnimator.PlayFadeOnly(detailBtm, 0, 0.12f, 0f, true);
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (detailBtm != null) detailBtm.SetActive(false);
|
||||
if (detailBtm == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CanvasGroup group = detailBtm.GetComponent<CanvasGroup>();
|
||||
if (group == null)
|
||||
{
|
||||
group = detailBtm.AddComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
group.DOKill();
|
||||
group.DOFade(0f, 0.1f)
|
||||
.SetEase(Ease.OutQuad)
|
||||
.SetUpdate(true)
|
||||
.SetTarget(detailBtm)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
if (detailBtm != null)
|
||||
{
|
||||
detailBtm.SetActive(false);
|
||||
group.alpha = 1f;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user