최초 페이지에서 프로젝트 명 없이 Create가 가능한 오류 수정 #147

Merged
UVCXR merged 1 commits from jym/250609_02 into main 2025-06-09 14:59:27 +09:00
4 changed files with 28 additions and 22 deletions

View File

@@ -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;
}
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;