52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Uis
|
|
{
|
|
public class TycoonManagementUi : SwitchActionPopupUi
|
|
{
|
|
[Title("컴포넌트")]
|
|
[SerializeField, Required]
|
|
private RectTransform _rectTransform;
|
|
|
|
[field: SerializeField, Required]
|
|
public CookMenuUi CookMenuUi { get; private set; }
|
|
|
|
private Tween _openTween;
|
|
private Tween _closeTween;
|
|
private bool _isQuitting;
|
|
|
|
private void Awake()
|
|
{
|
|
CookMenuUi.ShowUi();
|
|
}
|
|
|
|
private void OnApplicationQuit()
|
|
{
|
|
_isQuitting = true;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
if (_isQuitting) return;
|
|
|
|
_openTween.Kill();
|
|
_closeTween.Kill();
|
|
}
|
|
|
|
public override void Open()
|
|
{
|
|
_rectTransform.anchoredPosition = new Vector2(-960f, 0f);
|
|
base.Open();
|
|
_openTween = _rectTransform.DOAnchorPosX(960f, 0.5f).SetAutoKill(false);
|
|
}
|
|
|
|
public override void Close()
|
|
{
|
|
_closeTween = _rectTransform.DOAnchorPosX(-960f, 0.5f).SetAutoKill(false).
|
|
OnComplete(() => base.Close());
|
|
}
|
|
}
|
|
} |