79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
|
using System;
|
||
|
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;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private GameObject _cookMenuPanel;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _fryingPanFoodSlotLocation;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _soupFoodSlotLocation;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _skewerFoodSlotLocation;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _finishedFoodSlotLocation;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _ingredientFoodSlotLocation;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private Transform _tycoonItemSlotLocation;
|
||
|
|
||
|
[Title("프리팹")]
|
||
|
[SerializeField, Required]
|
||
|
private TycoonItemSlotUi _dailyFoodSlotUi;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private TycoonItemSlotUi _finishedFoodSlotUi;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private TycoonItemSlotUi _ingredientItemSlotUi;
|
||
|
|
||
|
[SerializeField, Required]
|
||
|
private TycoonItemSlotUi _tycoonItemSlotUi;
|
||
|
|
||
|
private Tween _openTween;
|
||
|
private Tween _closeTween;
|
||
|
private bool _isQuitting;
|
||
|
|
||
|
private void OnApplicationQuit()
|
||
|
{
|
||
|
_isQuitting = true;
|
||
|
}
|
||
|
|
||
|
private void OnDestroy()
|
||
|
{
|
||
|
if (_isQuitting) return;
|
||
|
|
||
|
_openTween.Kill();
|
||
|
_closeTween.Kill();
|
||
|
}
|
||
|
|
||
|
public override void Open(List<PopupUi> popupUiList)
|
||
|
{
|
||
|
_rectTransform.anchoredPosition = new Vector2(-960f, 0f);
|
||
|
base.Open(popupUiList);
|
||
|
_openTween = _rectTransform.DOAnchorPosX(960f, 0.5f).SetAutoKill(false);
|
||
|
}
|
||
|
|
||
|
public override void Close()
|
||
|
{
|
||
|
_closeTween = _rectTransform.DOAnchorPosX(-960f, 0.5f).SetAutoKill(false).
|
||
|
OnComplete(() => base.Close());
|
||
|
}
|
||
|
}
|
||
|
}
|