playback 버그 수정
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System; // System.Type 사용을 위해 추가
|
||||
using System.Threading;
|
||||
@@ -234,19 +234,19 @@ namespace UVC.UI.Modal
|
||||
// 기존 리스너 제거 후 새 리스너 추가
|
||||
modalView.confirmButton.onClick.RemoveAllListeners();
|
||||
// content.ShowConfirmButton 여부는 ModalView.OnOpen에서 버튼 자체의 활성화로 처리
|
||||
modalView.confirmButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, true, modalView));
|
||||
modalView.confirmButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, true, modalView, "confirm"));
|
||||
}
|
||||
|
||||
if (modalView.cancelButton != null)
|
||||
{
|
||||
modalView.cancelButton.onClick.RemoveAllListeners();
|
||||
modalView.cancelButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, false, modalView));
|
||||
modalView.cancelButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, false, modalView, "close"));
|
||||
}
|
||||
|
||||
if (modalView.closeButton != null)
|
||||
{
|
||||
modalView.closeButton.onClick.RemoveAllListeners();
|
||||
modalView.closeButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, false, modalView));
|
||||
modalView.closeButton.onClick.AddListener(() => _ = HandleModalActionAsync(content, tcs, false, modalView, "close"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,8 @@ namespace UVC.UI.Modal
|
||||
ModalContent content,
|
||||
UniTaskCompletionSource<T> tcs,
|
||||
bool isConfirmAction,
|
||||
ModalView modalViewContext)
|
||||
ModalView modalViewContext,
|
||||
string buttonType)
|
||||
{
|
||||
// 📜 이야기: 이 함수는 사용자가 버튼을 눌렀을 때 실행돼요.
|
||||
// 그런데 만약 이전에 처리하던 약속 증서(activeTcs)와 지금 받은 증서(tcs)가 다르거나,
|
||||
@@ -277,6 +278,19 @@ namespace UVC.UI.Modal
|
||||
// 📜 이야기: 사용자가 버튼을 하나 눌렀으니, 다른 버튼들은 잠깐 못 누르게 막아요. (실수로 두 번 누르는 것 방지)
|
||||
modalViewContext.SetAllButtonsInteractable(false);
|
||||
|
||||
if(buttonType == "confirm")
|
||||
{
|
||||
modalViewContext.OnConfirmButtonClicked();
|
||||
}
|
||||
else if (buttonType == "cancel")
|
||||
{
|
||||
modalViewContext.OnCancelButtonClicked();
|
||||
}
|
||||
else if (buttonType == "close")
|
||||
{
|
||||
modalViewContext.OnCloseButtonClicked();
|
||||
}
|
||||
|
||||
// 📜 이야기: 이제 모달을 닫고 뒷정리를 할 시간이에요!
|
||||
// CleanupCurrentModalResources 조수에게 "이 모달 뷰를 사용했고, 사용자는 '확인'(또는 '취소')을 눌렀어요" 라고 알려주며 뒷정리를 부탁해요.
|
||||
// 이 뒷정리 과정에서 '약속 증서'에 최종 결과가 기록될 거예요.
|
||||
|
||||
Reference in New Issue
Block a user