游戏资产类新增读取城镇

This commit is contained in:
Lenheart 2024-12-25 11:32:34 +08:00
parent 936b7b56a4
commit 788e91b94f
1 changed files with 18 additions and 1 deletions

View File

@ -12,6 +12,8 @@ class _AssetManager_ {
CharacterInfoList = null;
//地图列表
MapList = null;
//城镇列表
TownList = null;
//装备列表
EquipmentList = null;
@ -134,7 +136,23 @@ class _AssetManager_ {
});
}
function InitTownList() {
TownList = ScriptData.GetFileData("town/town.lst", function(DataTable, Data) {
while (!Data.Eof()) {
local Key = Data.Get();
//注册城镇列表 路径写入 数据未读取
DataTable.rawset(Key, {
Path = Data.Get(),
Data = null
});
}
if (_DEBUG_) print("加载城镇List完成, 共" + DataTable.len() + "个");
});
}
constructor() {
//初始化城镇列表
InitTownList();
//初始化地图列表
InitMapList();
//初始化角色
@ -143,7 +161,6 @@ class _AssetManager_ {
InitEquipmentList();
getroottable().AssetManager <- this;
}