All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 11s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 24s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 28s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 2s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 3s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 2s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 59s
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
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
|
|
}
|
|
} |