종료 팝업 UI 기능 개발
This commit is contained in:
48
Assets/WorkSpace/Personal/JYM/Panel_ExitProgram.cs
Normal file
48
Assets/WorkSpace/Personal/JYM/Panel_ExitProgram.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
|
||||
public class Panel_ExitProgram : PanelBase
|
||||
{
|
||||
public Button Button_Exit;
|
||||
public Button Button_Cancel;
|
||||
|
||||
private Panel_Effect effect;
|
||||
public Action<bool> isClickUI;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
Button_Exit.onClick.AddListener(OnClickExitButton);
|
||||
Button_Cancel.onClick.AddListener(OnClickCancelButton);
|
||||
effect = FindSingle<Panel_Effect>();
|
||||
}
|
||||
public void Open()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
effect.ActivePanel();
|
||||
gameObject.transform.SetAsLastSibling();
|
||||
isClickUI?.Invoke(true);
|
||||
}
|
||||
public void Close()
|
||||
{
|
||||
effect.DeactivePanel();
|
||||
gameObject.SetActive(false);
|
||||
isClickUI?.Invoke(false);
|
||||
}
|
||||
private void OnClickExitButton()
|
||||
{
|
||||
var mqtt = FindSingle<MQTT>();
|
||||
mqtt.Disconnect();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false;
|
||||
#else
|
||||
Application.Quit(); // ¾îÇø®ÄÉÀÌ¼Ç Á¾·á
|
||||
#endif
|
||||
}
|
||||
private void OnClickCancelButton()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
2
Assets/WorkSpace/Personal/JYM/Panel_ExitProgram.cs.meta
Normal file
2
Assets/WorkSpace/Personal/JYM/Panel_ExitProgram.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 869f6fb77fb01324ab106f500214db69
|
||||
Reference in New Issue
Block a user