New Project, OpenProject 시 입력 정보가 잘못된 경우 해당 입력창 UI 하이라이트 적용 #166
@@ -4223,6 +4223,7 @@ GameObject:
|
||||
- component: {fileID: 1215421424825789100}
|
||||
- component: {fileID: 3237974088270507350}
|
||||
- component: {fileID: 7781437951359503076}
|
||||
- component: {fileID: 2568825789228562020}
|
||||
m_Layer: 5
|
||||
m_Name: InputField_ProjectRoute
|
||||
m_TagString: Untagged
|
||||
@@ -4390,6 +4391,21 @@ MonoBehaviour:
|
||||
isAlert: 0
|
||||
m_InputValidator: {fileID: 0}
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &2568825789228562020
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6045950372922419404}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 1, g: 0, b: 0, a: 0}
|
||||
m_EffectDistance: {x: 1, y: -1}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &6119926203839472246
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5112,6 +5128,7 @@ GameObject:
|
||||
- component: {fileID: 3051697916339464255}
|
||||
- component: {fileID: 7025850301156575891}
|
||||
- component: {fileID: 2420147620014466822}
|
||||
- component: {fileID: 409873312456034788}
|
||||
m_Layer: 5
|
||||
m_Name: InputField_ProjectName
|
||||
m_TagString: Untagged
|
||||
@@ -5278,6 +5295,21 @@ MonoBehaviour:
|
||||
isAlert: 0
|
||||
m_InputValidator: {fileID: 0}
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &409873312456034788
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7114420628450455510}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 1, g: 0, b: 0, a: 0}
|
||||
m_EffectDistance: {x: 1, y: -1}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &7381463749175027285
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1470,6 +1470,7 @@ GameObject:
|
||||
- component: {fileID: 690843152395397420}
|
||||
- component: {fileID: 3426080986512915541}
|
||||
- component: {fileID: 8578852367055184770}
|
||||
- component: {fileID: 7898329979593988254}
|
||||
m_Layer: 5
|
||||
m_Name: InputField_ProjectName
|
||||
m_TagString: Untagged
|
||||
@@ -1636,6 +1637,21 @@ MonoBehaviour:
|
||||
isAlert: 0
|
||||
m_InputValidator: {fileID: 0}
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &7898329979593988254
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6206254914448314055}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 1, g: 0, b: 0, a: 0}
|
||||
m_EffectDistance: {x: 1, y: -1}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &6791370336908178505
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2451,6 +2467,7 @@ GameObject:
|
||||
- component: {fileID: 7223380533684380914}
|
||||
- component: {fileID: 5114126078834999655}
|
||||
- component: {fileID: 4177504299572712703}
|
||||
- component: {fileID: 2492899147223604304}
|
||||
m_Layer: 5
|
||||
m_Name: InputField_ProjectRoute
|
||||
m_TagString: Untagged
|
||||
@@ -2618,3 +2635,18 @@ MonoBehaviour:
|
||||
isAlert: 0
|
||||
m_InputValidator: {fileID: 0}
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &2492899147223604304
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9046724292656261623}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 1, g: 0, b: 0, a: 0}
|
||||
m_EffectDistance: {x: 1, y: -1}
|
||||
m_UseGraphicAlpha: 1
|
||||
|
||||
@@ -1033,6 +1033,7 @@ GameObject:
|
||||
- component: {fileID: 7302933557080329570}
|
||||
- component: {fileID: 6020157158691740455}
|
||||
- component: {fileID: 861918741281426438}
|
||||
- component: {fileID: 2875478437783657308}
|
||||
m_Layer: 5
|
||||
m_Name: InputField_ProjectRoute
|
||||
m_TagString: Untagged
|
||||
@@ -1200,6 +1201,21 @@ MonoBehaviour:
|
||||
isAlert: 0
|
||||
m_InputValidator: {fileID: 0}
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &2875478437783657308
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6112395419969745802}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 1, g: 0, b: 0, a: 0}
|
||||
m_EffectDistance: {x: 1, y: -1}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &7080535857353195513
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1141,9 +1141,9 @@ RectTransform:
|
||||
- {fileID: 2081494434516734423}
|
||||
m_Father: {fileID: 6029866318953262369}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 83.5, y: -190}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 83.5, y: 30}
|
||||
m_SizeDelta: {x: -333, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4316208365858436923
|
||||
@@ -2906,9 +2906,9 @@ RectTransform:
|
||||
- {fileID: 7115248029429128929}
|
||||
m_Father: {fileID: 6029866318953262369}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 83.5, y: -150}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 83.5, y: 70}
|
||||
m_SizeDelta: {x: -333, y: 24}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4708186645858634878
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Studio.Core;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -30,14 +32,15 @@ namespace Studio.UI
|
||||
|
||||
InputField_ProjectRoute.text = OptionURL.defaultPath;
|
||||
}
|
||||
|
||||
|
||||
private void OnClickFileExplorer()
|
||||
{
|
||||
var paths = StandaloneFileBrowser.OpenFolderPanel("Select Folder", "", false);
|
||||
|
||||
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
|
||||
{
|
||||
InputField_ProjectRoute.text = paths[0].Name;
|
||||
var path = Path.GetDirectoryName(paths[0].Name);
|
||||
InputField_ProjectRoute.text = path;
|
||||
}
|
||||
onClickFileExplorer?.Invoke();
|
||||
}
|
||||
@@ -47,8 +50,14 @@ namespace Studio.UI
|
||||
var projectName = GetProjectName();
|
||||
var projectPath = GetProjectRoute();
|
||||
|
||||
if (!IsProjectNameVaild(projectName) || !IsProjectPathVaild(projectPath) || !IsProjectExistVaild())
|
||||
if (!IsProjectNameVaild(projectName) || !IsProjectExistVaild())
|
||||
{
|
||||
InputFieldHighlight(InputField_ProjectName);
|
||||
return;
|
||||
}
|
||||
else if (!IsProjectPathVaild(projectPath))
|
||||
{
|
||||
InputFieldHighlight(InputField_ProjectRoute);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -107,5 +116,36 @@ namespace Studio.UI
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void InputFieldHighlight(TMP_InputField inputField)
|
||||
{
|
||||
CoroutineRunner.instance.StartCoroutine(Blink(inputField));
|
||||
}
|
||||
private IEnumerator Blink(TMP_InputField inputField)
|
||||
{
|
||||
var inputFieldOutline = inputField.GetComponent<Outline>();
|
||||
Color tempColor = inputFieldOutline.effectColor;
|
||||
var count = 0;
|
||||
|
||||
while (count < 1)
|
||||
{
|
||||
while (inputFieldOutline.effectColor.a <= 1f)
|
||||
{
|
||||
tempColor.a += 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
while (inputFieldOutline.effectColor.a >= 0f)
|
||||
{
|
||||
tempColor.a -= 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,9 @@ namespace Studio.UI
|
||||
|
||||
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
|
||||
{
|
||||
InputField_ProjectRoute.text = paths[0].Name;
|
||||
var path = Path.GetDirectoryName(paths[0].Name);
|
||||
|
||||
InputField_ProjectRoute.text = path;
|
||||
InputField_ProjectRoute.onEndEdit?.Invoke(InputField_ProjectRoute.text);
|
||||
}
|
||||
onClickFileExplorer?.Invoke();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Studio.Core;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using TMPro;
|
||||
using TriLibCore.SFB;
|
||||
@@ -32,7 +34,8 @@ namespace Studio.UI
|
||||
|
||||
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
|
||||
{
|
||||
InputField_ProjectRoute.text = paths[0].Name;
|
||||
var path = Path.GetDirectoryName(paths[0].Name);
|
||||
InputField_ProjectRoute.text = path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +44,14 @@ namespace Studio.UI
|
||||
var projectName = GetProjectName();
|
||||
var projectPath = GetProjectRoute();
|
||||
|
||||
if (!IsProjectNameVaild(projectName) || !IsProjectPathVaild(projectPath) || !IsProjectExistVaild())
|
||||
if (!IsProjectNameVaild(projectName) || !IsProjectExistVaild())
|
||||
{
|
||||
InputFieldHighlight(InputField_ProjectName);
|
||||
return;
|
||||
}
|
||||
else if (!IsProjectPathVaild(projectPath))
|
||||
{
|
||||
InputFieldHighlight(InputField_ProjectRoute);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,5 +108,36 @@ namespace Studio.UI
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void InputFieldHighlight(TMP_InputField inputField)
|
||||
{
|
||||
CoroutineRunner.instance.StartCoroutine(Blink(inputField));
|
||||
}
|
||||
private IEnumerator Blink(TMP_InputField inputField)
|
||||
{
|
||||
var inputFieldOutline = inputField.GetComponent<Outline>();
|
||||
Color tempColor = inputFieldOutline.effectColor;
|
||||
var count = 0;
|
||||
|
||||
while (count < 1)
|
||||
{
|
||||
while (inputFieldOutline.effectColor.a <= 1f)
|
||||
{
|
||||
tempColor.a += 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
while (inputFieldOutline.effectColor.a >= 0f)
|
||||
{
|
||||
tempColor.a -= 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Studio.Core;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using TMPro;
|
||||
using TriLibCore.SFB;
|
||||
@@ -32,7 +34,8 @@ namespace Studio.UI
|
||||
|
||||
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
|
||||
{
|
||||
InputField_ProjectRoute.text = paths[0].Name;
|
||||
var path = Path.GetDirectoryName(paths[0].Name);
|
||||
InputField_ProjectRoute.text = path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +44,10 @@ namespace Studio.UI
|
||||
var projectPath = GetProjectRoute();
|
||||
|
||||
if (!IsPathVaild(projectPath))
|
||||
{
|
||||
InputFieldHighlight(InputField_ProjectRoute);
|
||||
return;
|
||||
}
|
||||
|
||||
onClickOpen?.Invoke();
|
||||
}
|
||||
@@ -68,5 +74,36 @@ namespace Studio.UI
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void InputFieldHighlight(TMP_InputField inputField)
|
||||
{
|
||||
CoroutineRunner.instance.StartCoroutine(Blink(inputField));
|
||||
}
|
||||
private IEnumerator Blink(TMP_InputField inputField)
|
||||
{
|
||||
var inputFieldOutline = inputField.GetComponent<Outline>();
|
||||
Color tempColor = inputFieldOutline.effectColor;
|
||||
var count = 0;
|
||||
|
||||
while (count < 1)
|
||||
{
|
||||
while (inputFieldOutline.effectColor.a <= 1f)
|
||||
{
|
||||
tempColor.a += 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
while (inputFieldOutline.effectColor.a >= 0f)
|
||||
{
|
||||
tempColor.a -= 0.1f;
|
||||
inputFieldOutline.effectColor = tempColor;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user