zip压缩加载测试
This commit is contained in:
46
Assets/Main/Script/Runtime/LasterDoMain/VideoTableData.cs
Normal file
46
Assets/Main/Script/Runtime/LasterDoMain/VideoTableData.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user