46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using Stary.Evo;
|
|
using YooAsset;
|
|
|
|
namespace Main
|
|
{
|
|
public interface IVideoTableData : IData
|
|
{
|
|
UniTask LoadData(string videotabledata_asset);
|
|
Stary.Evo.TableTextConversion.VideoTableData.MessageInfo PlayVideoName(string vidid);
|
|
}
|
|
|
|
|
|
public class VideoTableData : AbstractData, IVideoTableData
|
|
{
|
|
private Stary.Evo.TableTextConversion.VideoTableData videoTableDatas;
|
|
|
|
|
|
protected override async void OnInit()
|
|
{
|
|
|
|
}
|
|
|
|
public async UniTask LoadData(string videotabledata_asset)
|
|
{
|
|
var handle = YooAssets.LoadAssetAsync<Stary.Evo.TableTextConversion.VideoTableData>(videotabledata_asset);
|
|
await handle.Task;
|
|
videoTableDatas = handle.GetAssetObject<Stary.Evo.TableTextConversion.VideoTableData>();
|
|
}
|
|
public Stary.Evo.TableTextConversion.VideoTableData.MessageInfo PlayVideoName(string vidid)
|
|
{
|
|
var info = videoTableDatas.infos.Find(x => x.vidid == vidid);
|
|
if (info != null && !info.filename.Contains("Video"))
|
|
{
|
|
info.filename="Video_"+info.filename;
|
|
}
|
|
return info;
|
|
}
|
|
|
|
|
|
public override void Dispose()
|
|
{
|
|
|
|
}
|
|
}
|
|
} |