프로그램 종료 이벤트 연결 및 File-OpenProject 예외 처리 #135
@@ -16,7 +16,6 @@ namespace Studio.Manage
|
||||
GameObject assetLibraryWindow = canvas_Popup.panel_assetlibrary.gameObject;
|
||||
GameObject repository = canvas_Popup.panel_datarepository.gameObject;
|
||||
|
||||
canvas_static.panel_studiotopbar.onClickAssetManager += canvas_Popup.panel_assetsetting.Open;
|
||||
canvas_static.panel_studiotopbar.onClickAssetLibraryWindow += (() => assetLibraryWindow.SetActive(true));
|
||||
canvas_static.panel_studiotopbar.onClickHierarchyWindow += (() => hierarchyWindow.SetActive(true));
|
||||
canvas_static.panel_studiotopbar.onClickDataStorage += (() => repository.SetActive(true));
|
||||
|
||||
@@ -29,8 +29,11 @@ namespace Studio.UI
|
||||
|
||||
panel_studiotopbar.onClickNewProject += projectManager.TopMenuNewProjectSettingData;
|
||||
panel_studiotopbar.onClickOpenProject += projectManager.TopMenuOpenProjectSettingData;
|
||||
panel_studiotopbar.onClickExit += () => CommandInvoker.instance.Invoke(new ExitProgramCommand());
|
||||
panel_studiotopbar.onClickSaveProject += () => CommandInvoker.instance.Invoke(new SaveProjectCommand());
|
||||
|
||||
panel_studiotopbar.onClickClose += () => CommandInvoker.instance.Invoke(new ExitProgramCommand());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Studio.UI
|
||||
public event Action onClickSaveProject;
|
||||
public event Action onClickSaveAsProject;
|
||||
public event Action onClickExit;
|
||||
public event Action onClickDataStorage;
|
||||
|
||||
|
||||
/*Window*/
|
||||
public Button Button_DataStorage;
|
||||
@@ -28,7 +28,8 @@ namespace Studio.UI
|
||||
public Button Button_AssetLibraryWindow;
|
||||
public Button Button_HierarchyWindow;
|
||||
|
||||
public event Action onClickAssetManager;
|
||||
public event Action onClickDataStorage;
|
||||
public event Action onClickDataUpdateSetting;
|
||||
public event Action onClickAssetLibraryWindow;
|
||||
public event Action onClickHierarchyWindow;
|
||||
|
||||
@@ -42,6 +43,14 @@ namespace Studio.UI
|
||||
public Button Button_Build;
|
||||
public Button Button_Run;
|
||||
|
||||
public event Action onClickBuild;
|
||||
public event Action onClickRun;
|
||||
|
||||
/*Window*/
|
||||
public Button Button_Close;
|
||||
|
||||
public event Action onClickClose;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
Button_NewProject.onClick.AddListener(OnClickNewProject);
|
||||
@@ -59,11 +68,13 @@ namespace Studio.UI
|
||||
Button_AuthSetting.onClick.AddListener(OnClickAuthSetting);
|
||||
Button_APISetting.onClick.AddListener(OnClickAPISetting);
|
||||
Button_MQTTSetting.onClick.AddListener(OnClickMQTTSetting);
|
||||
Button_AssetSetting.onClick.AddListener(OnClickAssetManager);
|
||||
Button_AssetSetting.onClick.AddListener(OnClickAssetSetting);
|
||||
|
||||
|
||||
Button_Build.onClick.AddListener(OnClickBuild);
|
||||
Button_Run.onClick.AddListener(OnClickRun);
|
||||
|
||||
Button_Close.onClick.AddListener(OnClickClose);
|
||||
}
|
||||
|
||||
private void OnClickMQTTSetting()
|
||||
@@ -89,6 +100,11 @@ namespace Studio.UI
|
||||
Debug.Log("On TopMenu Click App Setting");
|
||||
CanvasManager.instance.GetCanvas<Canvas_Popup>().panel_appsetting.SetActive(true);
|
||||
}
|
||||
void OnClickAssetSetting()
|
||||
{
|
||||
Debug.Log("On Click Asset Manager");
|
||||
CanvasManager.instance.GetCanvas<Canvas_Popup>().panel_assetsetting.SetActive(true);
|
||||
}
|
||||
|
||||
private void OnClickNewProject()
|
||||
{
|
||||
@@ -129,14 +145,10 @@ namespace Studio.UI
|
||||
private void OnClickDataUpdateSetting()
|
||||
{
|
||||
Debug.Log("On Click Data Update Setting");
|
||||
onClickSaveProject?.Invoke();
|
||||
onClickDataUpdateSetting?.Invoke();
|
||||
}
|
||||
|
||||
void OnClickAssetManager()
|
||||
{
|
||||
Debug.Log("On Click Asset Manager");
|
||||
onClickAssetManager?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
void OnClickAssetLibraryWindow()
|
||||
{
|
||||
@@ -154,13 +166,18 @@ namespace Studio.UI
|
||||
private void OnClickBuild()
|
||||
{
|
||||
Debug.Log("On Click Build");
|
||||
onClickSaveAsProject?.Invoke();
|
||||
onClickBuild?.Invoke();
|
||||
}
|
||||
|
||||
private void OnClickRun()
|
||||
{
|
||||
Debug.Log("On Click Run");
|
||||
onClickExit?.Invoke();
|
||||
onClickRun?.Invoke();
|
||||
}
|
||||
private void OnClickClose()
|
||||
{
|
||||
Debug.Log("On Click Close");
|
||||
onClickClose?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using TMPro;
|
||||
using TriLibCore.SFB;
|
||||
using UnityEngine;
|
||||
@@ -37,6 +38,11 @@ namespace Studio.UI
|
||||
|
||||
private void OnClickOpen()
|
||||
{
|
||||
var projectPath = GetProjectRoute();
|
||||
|
||||
if (!IsPathVaild(projectPath))
|
||||
return;
|
||||
|
||||
onClickOpen?.Invoke();
|
||||
}
|
||||
|
||||
@@ -54,5 +60,19 @@ namespace Studio.UI
|
||||
var route = InputField_ProjectRoute.text;
|
||||
return route;
|
||||
}
|
||||
private bool IsPathVaild(string path)
|
||||
{
|
||||
if (path == string.Empty)
|
||||
{
|
||||
Debug.Log("The project path entry field is empty");
|
||||
return false;
|
||||
}
|
||||
else if (!File.Exists(path))
|
||||
{
|
||||
Debug.Log("The path you entered is not a valid path");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user