From 8dabd9731ed9c644cc793d30f22833b0f3328efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=98=81=EB=AF=BC?= <117150306+jym04@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:56:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B5=9C=EC=B4=88=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=EC=84=9C=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EB=AA=85=20=EC=97=86=EC=9D=B4=20Create=EA=B0=80=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Studio/UI/Panel/Panel_NewProjectInfo.cs | 25 +++++++++++++++++++ .../Studio/UI/Panel/Panel_OpenProjectInfo.cs | 8 +----- .../UI/Panel/Panel_TopMenuNewProjectInfo.cs | 9 +------ .../UI/Panel/Panel_TopMenuOpenProjectInfo.cs | 8 +----- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_NewProjectInfo.cs b/Assets/Scripts/Studio/UI/Panel/Panel_NewProjectInfo.cs index 736aa78b..878547a7 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_NewProjectInfo.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_NewProjectInfo.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using TMPro; using TriLibCore.SFB; @@ -43,6 +44,14 @@ namespace Studio.UI private void OnClickCreate() { + var projectName = GetProjectName(); + var projectPath = GetProjectRoute(); + + if (!IsProjectNameVaild(projectName) || !IsProjectPathVaild(projectPath)) + { + return; + } + onClickCreate?.Invoke(); } @@ -70,6 +79,22 @@ namespace Studio.UI var template = InputField_ProjectTemplate.text; return template; } + private bool IsProjectNameVaild(string projectName) + { + if (projectName == string.Empty) + { + return false; + } + return true; + } + private bool IsProjectPathVaild(string projectPath) + { + if (projectPath == string.Empty || !Directory.Exists(projectPath)) + { + return false; + } + return true; + } } } diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_OpenProjectInfo.cs b/Assets/Scripts/Studio/UI/Panel/Panel_OpenProjectInfo.cs index f3c929ef..615f21b1 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_OpenProjectInfo.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_OpenProjectInfo.cs @@ -124,14 +124,8 @@ namespace Studio.UI } private bool IsPathVaild(string path) { - if(path == string.Empty) + if(path == string.Empty || !File.Exists(path)) { - 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; diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuNewProjectInfo.cs b/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuNewProjectInfo.cs index 0e7144d1..25a8b377 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuNewProjectInfo.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuNewProjectInfo.cs @@ -75,21 +75,14 @@ namespace Studio.UI { if(projectName == string.Empty) { - Debug.Log("The project name entry field is empty"); return false; } return true; } private bool IsProjectPathVaild(string projectPath) { - if (projectPath == string.Empty) + if (projectPath == string.Empty || !Directory.Exists(projectPath)) { - Debug.Log("The project path entry field is empty"); - return false; - } - else if (!Directory.Exists(projectPath)) - { - Debug.Log("The path you entered is not a valid path"); return false; } return true; diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuOpenProjectInfo.cs b/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuOpenProjectInfo.cs index 4b32cc3f..896010a9 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuOpenProjectInfo.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_TopMenuOpenProjectInfo.cs @@ -62,14 +62,8 @@ namespace Studio.UI } private bool IsPathVaild(string path) { - if (path == string.Empty) + if (path == string.Empty || !File.Exists(path)) { - 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; -- 2.48.1.windows.1