File-NewProject 에서 파일 이름과 경로를 설정하지 않아도 Create가 되어 다음으로 넘어가는 문제 수정 #126
@@ -737,7 +737,7 @@ GameObject:
|
||||
- component: {fileID: 8162743357372848692}
|
||||
- component: {fileID: 7397105180311803632}
|
||||
m_Layer: 5
|
||||
m_Name: CloseButton
|
||||
m_Name: Button_Close
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -778,20 +778,20 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3525638003688093773}
|
||||
m_Enabled: 0
|
||||
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_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
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_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -2091,6 +2091,7 @@ MonoBehaviour:
|
||||
Button_FileExplorer: {fileID: 0}
|
||||
Button_Create: {fileID: 0}
|
||||
Button_Cancel: {fileID: 0}
|
||||
Button_Close: {fileID: 0}
|
||||
--- !u!1 &8486732318977483572
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -431,7 +431,7 @@ GameObject:
|
||||
- component: {fileID: 7272168518192265823}
|
||||
- component: {fileID: 120601648185626953}
|
||||
m_Layer: 5
|
||||
m_Name: CloseButton
|
||||
m_Name: Button_Close
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -472,20 +472,20 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1576574749633965993}
|
||||
m_Enabled: 0
|
||||
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_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
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_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -637,6 +637,7 @@ MonoBehaviour:
|
||||
Button_FileExplorer: {fileID: 0}
|
||||
Button_Open: {fileID: 0}
|
||||
Button_Cancel: {fileID: 0}
|
||||
Button_Close: {fileID: 0}
|
||||
--- !u!1 &2659655815345462576
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using TMPro;
|
||||
using TriLibCore.SFB;
|
||||
using UnityEngine;
|
||||
@@ -14,6 +15,7 @@ namespace Studio.UI
|
||||
public Button Button_FileExplorer;
|
||||
public Button Button_Create;
|
||||
public Button Button_Cancel;
|
||||
public Button Button_Close;
|
||||
|
||||
public Action onClickCreate;
|
||||
|
||||
@@ -22,6 +24,7 @@ namespace Studio.UI
|
||||
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
|
||||
Button_Create.onClick.AddListener(OnClickCreate);
|
||||
Button_Cancel.onClick.AddListener(Close);
|
||||
Button_Close.onClick.AddListener(Close);
|
||||
}
|
||||
private void OnClickFileExplorer()
|
||||
{
|
||||
@@ -35,6 +38,14 @@ namespace Studio.UI
|
||||
|
||||
private void OnClickCreate()
|
||||
{
|
||||
var projectName = GetProjectName();
|
||||
var projectPath = GetProjectRoute();
|
||||
|
||||
if (!IsProjectNameVaild(projectName) || !IsProjectPathVaild(projectPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
onClickCreate?.Invoke();
|
||||
}
|
||||
|
||||
@@ -57,5 +68,28 @@ namespace Studio.UI
|
||||
var route = InputField_ProjectRoute.text;
|
||||
return route;
|
||||
}
|
||||
private bool IsProjectNameVaild(string projectName)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Studio.UI
|
||||
public Button Button_FileExplorer;
|
||||
public Button Button_Open;
|
||||
public Button Button_Cancel;
|
||||
public Button Button_Close;
|
||||
|
||||
public Action onClickOpen;
|
||||
|
||||
@@ -22,6 +23,7 @@ namespace Studio.UI
|
||||
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
|
||||
Button_Open.onClick.AddListener(OnClickOpen);
|
||||
Button_Cancel.onClick.AddListener(Close);
|
||||
Button_Close.onClick.AddListener(Close);
|
||||
}
|
||||
private void OnClickFileExplorer()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user