/// <summary> /// @brief ポップアップを閉じるアニメーション関数 /// </summary> void OnCloseAnimation() { var tweener = popupWindow.DOScale(new Vector3(1, 0), time).SetEase(Ease.InOutQuart); tweener.OnStart(() => { if (closeAction.begin != null) { closeAction.begin.Invoke(); closeAction.begin = null; } popupButton.transform.SetActive(false); PopupState = EPopupState.CloseBegin; }) .OnUpdate(() => { if (closeAction.run != null) { closeAction.run.Invoke(); closeAction.run = null; } PopupState = EPopupState.Closing; }) .OnComplete(() => { if (closeAction.end != null) { closeAction.end.Invoke(); closeAction.end = null; } blackFade.transform.SetActive(false); PopupState = EPopupState.CloseEnd; }); }
/// <summary> /// @brief ポップアップを開くアニメーション用関数 /// </summary> void OnOpen() { var tweener = popupWindow.DOScale(new Vector3(1, 1), time).SetEase(Ease.InOutQuart); tweener .OnStart(() => { blackFade.transform.SetActive(true); if (openAction.begin != null) { openAction.begin.Invoke(); openAction.begin = null; } PopupState = EPopupState.OpenBegin; }) .OnUpdate(() => { if (openAction.run != null) { openAction.run.Invoke(); openAction.run = null; } PopupState = EPopupState.Openning; }) .OnComplete(() => { if (openAction.end != null) { openAction.end.Invoke(); openAction.end = null; } PopupState = EPopupState.OpenEnd; popupButton.transform.SetActive(true); }); }