50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using Animancer;
|
|
using TH1Resource;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace TH1_UI.View.Bottom
|
|
{
|
|
public class UIBottomBottomBarQuitPanelMono : MonoBehaviour
|
|
{
|
|
public AnimancerComponent Animancer;
|
|
public Button CancelButton;
|
|
public Button RestartButton;
|
|
public Button CheckButton;
|
|
|
|
// 确认退出时执行的委托
|
|
public ViDelegateAssisstant.Dele OnQuitConfirm;
|
|
|
|
public void OnInit()
|
|
{
|
|
CancelButton.onClick.RemoveAllListeners();
|
|
CancelButton.onClick.AddListener(OnClose);
|
|
CheckButton.onClick.RemoveAllListeners();
|
|
CheckButton.onClick.AddListener(OnConfirm);
|
|
RestartButton.onClick.RemoveAllListeners();
|
|
// RestartButton 暂时留空
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
public void Open()
|
|
{
|
|
gameObject.SetActive(true);
|
|
Animancer.Play(ResourceCache.Instance.AnimCache.UICommonPanelFadeIn);
|
|
}
|
|
|
|
public void OnClose()
|
|
{
|
|
AnimancerState state = Animancer.Play(ResourceCache.Instance.AnimCache.UICommonPanelFadeOut);
|
|
state.Events.OnEnd += () =>
|
|
{
|
|
gameObject.SetActive(false);
|
|
};
|
|
}
|
|
|
|
private void OnConfirm()
|
|
{
|
|
OnQuitConfirm?.Invoke();
|
|
}
|
|
}
|
|
}
|