mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
|
using System.Threading.Tasks;
|
|||
|
using Cysharp.Threading.Tasks;
|
|||
|
using GameConfig;
|
|||
|
// using HotScripts.GameLauncher;
|
|||
|
using JNGame.Runtime.System;
|
|||
|
using Luban;
|
|||
|
using SHFrame;
|
|||
|
using UnityEngine;
|
|||
|
using YooAsset;
|
|||
|
|
|||
|
namespace HotScripts.GameScripts.Luban
|
|||
|
{
|
|||
|
public class LubanManager : SystemBase
|
|||
|
{
|
|||
|
|
|||
|
private Tables _tables;
|
|||
|
|
|||
|
public Tables Tables => _tables;
|
|||
|
|
|||
|
public override async Task OnInit()
|
|||
|
{
|
|||
|
await UniTask.DelayFrame(1);
|
|||
|
Log.Debug($"配置文件 初始化中");
|
|||
|
// App.EventLauncher.DispatchEvent(HotLauncherEvent.InitSystem,$"配置文件 初始化中");
|
|||
|
_tables = new Tables(LoadByteBuf);
|
|||
|
Log.Debug($"配置文件 初始化完成 {Tables.TbGMap.DataList[0].MapName}");
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 加载二进制配置。
|
|||
|
/// </summary>
|
|||
|
/// <param name="file">FileName</param>
|
|||
|
/// <returns>ByteBuf</returns>
|
|||
|
private ByteBuf LoadByteBuf(string file)
|
|||
|
{
|
|||
|
var handle = YooAssets.LoadAssetSync<TextAsset>(file);
|
|||
|
return new ByteBuf((handle.AssetObject as TextAsset)?.bytes);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|