프로그램 종료 시 팝업 표시

This commit is contained in:
정영민
2025-07-15 16:09:26 +09:00
parent 2c71f12aa8
commit a12f694a98
8 changed files with 163 additions and 224 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

View File

@@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 8ad8d41189c5bf9428c9103095dadcaa
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -12,7 +12,6 @@ GameObject:
- component: {fileID: 6151067767286235112}
- component: {fileID: 861303901904461482}
- component: {fileID: 7934891842970306563}
- component: {fileID: 7477487618421383511}
m_Layer: 5
m_Name: Button_SaveAndExit
m_TagString: Untagged
@@ -61,7 +60,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -122,24 +121,6 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &7477487618421383511
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 670005885428711110}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cbcda1b47b95ac34ab2023046cb7f99c, type: 3}
m_Name:
m_EditorClassIdentifier:
buttonImage: {fileID: 0}
buttonTexts: []
buttonNormalColor: {r: 1, g: 1, b: 1, a: 1}
textNormalColor: {r: 0, g: 0, b: 0, a: 1}
buttonHoverColor: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
textHoverColor: {r: 1, g: 1, b: 1, a: 1}
--- !u!1 &846357756504546102
GameObject:
m_ObjectHideFlags: 0
@@ -205,17 +186,17 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Save And Exit
m_text: Save and Exit
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_fontAsset: {fileID: 11400000, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_sharedMaterial: {fileID: 8797862963918382650, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@@ -310,7 +291,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 125, y: 0}
m_AnchoredPosition: {x: 120.05, y: 0}
m_SizeDelta: {x: 200, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8464415119403775393
@@ -343,8 +324,8 @@ MonoBehaviour:
m_Calls: []
m_text: Save Checker
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 69abd87f38225ed46aa612577c25f379, type: 2}
m_sharedMaterial: {fileID: -7290017371581542385, guid: 69abd87f38225ed46aa612577c25f379, type: 2}
m_fontAsset: {fileID: 11400000, guid: 9a2c7e704ad3e62438526dc8aecaeb56, type: 2}
m_sharedMaterial: {fileID: 682561501981441939, guid: 9a2c7e704ad3e62438526dc8aecaeb56, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
@@ -368,8 +349,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 20
m_fontSizeBase: 20
m_fontSize: 14
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -727,7 +708,6 @@ GameObject:
- component: {fileID: 4536888433963024969}
- component: {fileID: 953735980653277523}
- component: {fileID: 5493726431069590353}
- component: {fileID: 275756783292877850}
m_Layer: 5
m_Name: Button_Exit
m_TagString: Untagged
@@ -837,24 +817,6 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &275756783292877850
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5646109820132938901}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cbcda1b47b95ac34ab2023046cb7f99c, type: 3}
m_Name:
m_EditorClassIdentifier:
buttonImage: {fileID: 0}
buttonTexts: []
buttonNormalColor: {r: 1, g: 1, b: 1, a: 1}
textNormalColor: {r: 0, g: 0, b: 0, a: 1}
buttonHoverColor: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
textHoverColor: {r: 1, g: 1, b: 1, a: 1}
--- !u!1 &5904588325456822339
GameObject:
m_ObjectHideFlags: 0
@@ -880,7 +842,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5904588325456822339}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -932,7 +894,7 @@ GameObject:
- component: {fileID: 5611348283481754667}
- component: {fileID: 1582013873697476102}
m_Layer: 5
m_Name: CloseButton
m_Name: Button_Close
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -949,14 +911,13 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8967253186994863797}
m_Children: []
m_Father: {fileID: 2754819924416310632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -18.5, y: -18.5}
m_SizeDelta: {x: 37, y: 37}
m_AnchoredPosition: {x: -25, y: -18.5}
m_SizeDelta: {x: 10, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6227962628465810198
CanvasRenderer:
@@ -973,7 +934,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262190851957657318}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
@@ -1072,9 +1033,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 8789936807297394088}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 10}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -93.1}
m_SizeDelta: {x: 350, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2194821260608468198
@@ -1105,10 +1066,10 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\uD504\uB85C\uC81D\uD2B8\uB97C \uC885\uB8CC \uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?"
m_text: "\uD504\uB85C\uC81D\uD2B8\uB97C \uC885\uB8CC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_fontAsset: {fileID: 11400000, guid: 69abd87f38225ed46aa612577c25f379, type: 2}
m_sharedMaterial: {fileID: -7290017371581542385, guid: 69abd87f38225ed46aa612577c25f379, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
@@ -1176,81 +1137,6 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &6695520421312852153
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8967253186994863797}
- component: {fileID: 6025308165286342440}
- component: {fileID: 4220981858183742867}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8967253186994863797
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6695520421312852153}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5531872798316303705}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6025308165286342440
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6695520421312852153}
m_CullTransparentMesh: 1
--- !u!114 &4220981858183742867
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6695520421312852153}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 728e2097784c8d14791210ed0d397ddc, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7930531528987856531
GameObject:
m_ObjectHideFlags: 0
@@ -1318,8 +1204,8 @@ MonoBehaviour:
m_Calls: []
m_text: Exit
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_fontAsset: {fileID: 11400000, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_sharedMaterial: {fileID: 8797862963918382650, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
@@ -1399,7 +1285,6 @@ GameObject:
- component: {fileID: 4884056858812026018}
- component: {fileID: 1963939506510375294}
- component: {fileID: 2013050771796126913}
- component: {fileID: 1540547665640537554}
m_Layer: 5
m_Name: Button_Cancel
m_TagString: Untagged
@@ -1509,24 +1394,6 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1540547665640537554
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8111898347497520866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cbcda1b47b95ac34ab2023046cb7f99c, type: 3}
m_Name:
m_EditorClassIdentifier:
buttonImage: {fileID: 0}
buttonTexts: []
buttonNormalColor: {r: 1, g: 1, b: 1, a: 1}
textNormalColor: {r: 0, g: 0, b: 0, a: 1}
buttonHoverColor: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
textHoverColor: {r: 1, g: 1, b: 1, a: 1}
--- !u!1 &8570347261885188375
GameObject:
m_ObjectHideFlags: 0
@@ -1594,8 +1461,8 @@ MonoBehaviour:
m_Calls: []
m_text: Cancel
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
m_fontAsset: {fileID: 11400000, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_sharedMaterial: {fileID: 8797862963918382650, guid: 414be81bcdc9caa4a8dc790330504c1a, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []

View File

@@ -1,3 +1,5 @@
using Studio.Manage;
using Studio.UI;
using UnityEngine;
namespace Studio.Command
@@ -18,8 +20,8 @@ namespace Studio.Command
public void Execute()
{
Debug.Log("Exit");
Application.Quit();
var canvasPopup = CanvasManager.instance.GetCanvas<Canvas_Popup>();
canvasPopup.panel_exitchecker.Open();
}
}
}

View File

@@ -6,54 +6,9 @@ namespace Studio.Manage
public class QuitManager : MonoBehaviour
{
private bool quitConfirmed;
private bool popupOpened;
public Action onOpen;
private void OnEnable()
{
//Application.wantsToQuit += HandleForcedExitRequest;
}
protected override void OnDestroy()
{
//Application.wantsToQuit -= HandleForcedExitRequest;
}
public bool HandleForcedExitRequest()
{
if (quitConfirmed)
return true;
if (!popupOpened)
{
popupOpened = true;
onOpen?.Invoke();
}
return false;
}
public void HandleManualExitRequest()
{
if (!popupOpened)
{
popupOpened = true;
onOpen?.Invoke();
}
}
public void OnConfirmQuit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
quitConfirmed = true;
Application.Quit();
}
public void OnCancelQuit()
{
popupOpened = false;
}
}
}

View File

@@ -79,7 +79,6 @@ namespace Studio
var assetManager = ManagerHub.instance.Get<AssetManager>();
var dataManager = FindAnyObjectByType<ConnectDataManager>();
var quitManager = FindAnyObjectByType<QuitManager>();
panel_newprojectinfo.onClickCreate += () => CommandInvoker.instance.Invoke(new NewProjectCommand());
panel_openprojectinfo.onClickOpen += () => CommandInvoker.instance.Invoke(new OpenProjectCommand());
@@ -97,11 +96,6 @@ namespace Studio
dataManager.mqttData += panel_datafiltersetting.SetLoadMQTTDataList;
dataManager.apiData += panel_datafiltersetting.SetLoadAPIDataList;
panel_exitchecker.onSaveAndExit += quitManager.OnConfirmQuit;
panel_exitchecker.onExit += quitManager.OnConfirmQuit;
panel_exitchecker.onCancel += quitManager.OnCancelQuit;
}
void SetPanelAsLastSibling(UIBase panel)

View File

@@ -22,7 +22,6 @@ namespace Studio.UI
private void Awake()
{
var dataManager = FindAnyObjectByType<ConnectDataManager>();
var quitManager = FindAnyObjectByType<QuitManager>();
canvasHandler = new StudioPopupCanvasHandler(this);
@@ -31,10 +30,6 @@ namespace Studio.UI
dataManager.mqttData += panel_datafiltersetting.SetLoadMQTTDataList;
dataManager.apiData += panel_datafiltersetting.SetLoadAPIDataList;
panel_exitchecker.onSaveAndExit += quitManager.OnConfirmQuit;
panel_exitchecker.onExit += quitManager.OnConfirmQuit;
panel_exitchecker.onCancel += quitManager.OnCancelQuit;
}
}
}

View File

@@ -2,6 +2,7 @@ using UnityEngine;
using XRLib.UI;
using UnityEngine.UI;
using System;
using Studio.Command;
namespace Studio.UI
{
@@ -10,24 +11,23 @@ namespace Studio.UI
private Button Button_SaveAndExit;
private Button Button_Exit;
private Button Button_Cancel;
private Button Button_Close;
public Action onSaveAndExit;
public Action onExit;
public Action onCancel;
private bool isSaveData;
public override void AfterAwake()
{
Button_SaveAndExit.onClick.AddListener(OnClickSaveAndExitButton);
Button_Exit.onClick.AddListener(OnClickExitButton);
Button_Cancel.onClick.AddListener(OnClickCancelButton);
Button_Close.onClick.AddListener(Close);
}
public void Open()
{
gameObject.SetActive(true);
Button_SaveAndExit.gameObject.SetActive(isSaveData);
}
public void Close()
{
@@ -36,16 +36,25 @@ namespace Studio.UI
private void OnClickSaveAndExitButton()
{
onSaveAndExit?.Invoke();
var saveCommand = new SaveProjectCommand();
CommandInvoker.instance.Invoke(saveCommand);
QuitProgram();
}
private void OnClickExitButton()
{
onExit?.Invoke();
QuitProgram();
}
private void OnClickCancelButton()
{
Close();
onCancel?.Invoke();
}
private void QuitProgram()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
Application.Quit();
}
}
}