111
This commit is contained in:
@@ -8,32 +8,33 @@ namespace Stary.Evo.TableTextConversion
|
||||
public interface IVideoTableDataCore : ITableDataCore
|
||||
{
|
||||
UniTask LoadData();
|
||||
UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid);
|
||||
UniTask<VideoEntity> PlayVideoAssetName(string vidid);
|
||||
}
|
||||
|
||||
|
||||
#if YooAssets
|
||||
public class VideoTableDataCore : IVideoTableDataCore, IDisposable
|
||||
{
|
||||
public string TableName => "Config_VideoTableData";
|
||||
public bool IsLoad { get; set; }
|
||||
private Stary.Evo.TableTextConversion.VideoTableData videoTableDatas;
|
||||
private VideoTableData videoTableDatas;
|
||||
|
||||
|
||||
public async UniTask LoadData()
|
||||
{
|
||||
var handle = YooAssets.LoadAssetAsync<Stary.Evo.TableTextConversion.VideoTableData>(TableName);
|
||||
var handle = YooAssets.LoadAssetAsync<VideoTableData>(TableName);
|
||||
await handle.Task;
|
||||
videoTableDatas = handle.GetAssetObject<Stary.Evo.TableTextConversion.VideoTableData>();
|
||||
videoTableDatas = handle.GetAssetObject<VideoTableData>();
|
||||
if (videoTableDatas == null)
|
||||
{
|
||||
Debug.LogError($"加载视频表失败,请排查config下是否存在【{TableName}】表");
|
||||
return;
|
||||
}
|
||||
|
||||
IsLoad = true;
|
||||
}
|
||||
|
||||
|
||||
public async UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid)
|
||||
public async UniTask<VideoEntity> PlayVideoAssetName(string vidid)
|
||||
{
|
||||
if (!IsLoad)
|
||||
{
|
||||
@@ -59,4 +60,5 @@ namespace Stary.Evo.TableTextConversion
|
||||
videoTableDatas = null;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user