43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using asap.core;
|
|
using game;
|
|
using GameCore;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SettingNotificationsGradePopupPanel : MonoBehaviour
|
|
{
|
|
public Button btn_ok;
|
|
public Button btn_cancel;
|
|
private ISettingService settings;
|
|
private ILocalNotificationService notifications;
|
|
private void Start()
|
|
{
|
|
settings = GContext.container.Resolve<ISettingService>();
|
|
notifications = GContext.container.Resolve<ILocalNotificationService>();
|
|
btn_ok.onClick.AddListener(OnBtnOk);
|
|
btn_cancel.onClick.AddListener(DestroyUI);
|
|
}
|
|
private void OnBtnOk()
|
|
{
|
|
if (this == null)
|
|
{
|
|
return;
|
|
}
|
|
(settings as DefaultSettingService)?.RequirePromptOwner();
|
|
(notifications as LocalNotificationService)?.RequirePromptOwner(settings);
|
|
DestroyUI();
|
|
notifications.OpenSettings();
|
|
}
|
|
void DestroyUI()
|
|
{
|
|
if (this == null)
|
|
{
|
|
return;
|
|
}
|
|
(settings as DefaultSettingService)?.RequirePromptOwner();
|
|
(notifications as LocalNotificationService)?.RequirePromptOwner(settings);
|
|
settings.ShowNotice = true;
|
|
UIManager.Instance.DestroyUI(gameObject.name);
|
|
}
|
|
}
|