chore(m2): 保存功能验收及后续清理前检查点
This commit is contained in:
@@ -7,48 +7,30 @@ public class SettingNotificationsPopupPanel : MonoBehaviour
|
||||
{
|
||||
public Button btn_ok;
|
||||
public Button btn_cancel;
|
||||
ILocalNotificationService notifications;
|
||||
bool handling;
|
||||
bool completed;
|
||||
private ILocalNotificationService notifications;
|
||||
private void Start()
|
||||
{
|
||||
notifications = GContext.container.Resolve<ILocalNotificationService>();
|
||||
btn_ok.onClick.AddListener(OnBtnOk);
|
||||
btn_cancel.onClick.AddListener(DestroyUI);
|
||||
}
|
||||
private async void OnBtnOk()
|
||||
private void OnBtnOk()
|
||||
{
|
||||
if (this == null || handling || completed) return;
|
||||
handling = true;
|
||||
try
|
||||
if (this == null)
|
||||
{
|
||||
if (notifications is LocalNotificationService local && local.HasKVPromptOwner)
|
||||
{
|
||||
local.RequirePromptOwner();
|
||||
await local.OpenSettingsAsync();
|
||||
if (this == null) return;
|
||||
local.RequirePromptOwner();
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyUI();
|
||||
notifications.OpenSettings();
|
||||
return;
|
||||
}
|
||||
DestroyUI();
|
||||
return;
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
finally { handling = false; }
|
||||
(notifications as LocalNotificationService)?.RequirePromptOwner();
|
||||
DestroyUI();
|
||||
notifications.OpenSettings();
|
||||
}
|
||||
void DestroyUI()
|
||||
{
|
||||
if (this == null || completed) return;
|
||||
try
|
||||
if (this == null)
|
||||
{
|
||||
(notifications as LocalNotificationService)?.RequirePromptOwner();
|
||||
completed = true;
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
return;
|
||||
}
|
||||
catch (System.Exception ex) { game.DefaultSettingService.LogPromptFailure(ex); }
|
||||
(notifications as LocalNotificationService)?.RequirePromptOwner();
|
||||
UIManager.Instance.DestroyUI(gameObject.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user