최초 페이지에서 프로젝트 명 없이 Create가 가능한 오류 수정 #147
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user