This commit is contained in:
Han
2025-04-01 18:26:48 +08:00
parent c3e2616c3a
commit ac499e2202
39 changed files with 1258 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
using System.Threading.Tasks;
using UnityEngine;
using YooAsset;
namespace Stary.Evo.TableTextConversion
{
public static class ReadDumpInformation
{
public static async Task<T> Read<T>() where T : ScriptableObject, ITableData
{
var conf = YooAssets.LoadAssetAsync($"Config_{typeof(T).Name}");
await conf.Task;
if (conf.Status == EOperationStatus.Succeed)
{
return conf.AssetObject as T;
}
else
{
Debug.LogError("UnityEvo:" + "配置文件:" + typeof(T).Name + "加载失败!!!");
return null;
}
}
#if UNITY_EDITOR
public static T ReadInEditor<T>() where T : ScriptableObject, ITableData
{
// 同步加载并直接返回结果
var conf = Resources.Load<T>(typeof(T).Name);
if (conf != null)
{
return conf;
}
Debug.LogError($"UnityEvo:配置文件同步加载失败:{typeof(T).Name}");
return null;
}
#endif
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 64089130470a47d496bd6c8168cd95f6
timeCreated: 1743415570