working on dialogs system

This commit is contained in:
Hubert Mattusch 2023-10-25 20:52:17 +02:00
parent b7aa670e70
commit cd8c819585
2 changed files with 44 additions and 0 deletions

41
Editor/EditorUtils.cs Normal file
View File

@ -0,0 +1,41 @@
using System;
using UnityEditor;
namespace NegUtils.Editor
{
public class EditorUtils
{
}
public class AssetPath
{
public string Path
{
get
{
if (path != null)
return path;
TryFindPath();
return path;
}
}
private string path;
private readonly string filter;
public AssetPath(string filter)
{
this.filter = filter;
TryFindPath();
}
private void TryFindPath()
{
string[] candidates = AssetDatabase.FindAssets(filter);
if (candidates.Length == 0)
throw new Exception("Missing layout asset!");
path = AssetDatabase.GUIDToAssetPath(candidates[0]);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a4848b69c1024df8ad6f76cfd4415d01
timeCreated: 1698258811