CSUI:partener数据存在解析问题

This commit is contained in:
fatiao 2025-04-03 10:20:34 +08:00
parent 49506ec51b
commit c26b982474
2 changed files with 22 additions and 2 deletions

View File

@ -151,7 +151,7 @@ public class GenerateLuaTemple
UICfgData data1 = config.Value;
className = data1.name;
luaPath = data1.res_path;
filePath = string.Format(CSViewDirPath, "View");
filePath = string.Format(CSViewDirPath, $"{className}View");
data.type = 0;
}
@ -187,7 +187,7 @@ public class GenerateLuaTemple
Debug.Log(string.Format("[Test] {0} {1} {2} {3}", gameObject.name, className, filePath, luaPath));
if (data.type == 0)
{
GenerateCSView(gameObject, className, filePath, luaPath);
//GenerateCSView(gameObject, className, filePath, luaPath);
string generatePath = filePath.Replace(".cs", "_Generate.cs");
GenerateCSMap(gameObject, className, generatePath, luaPath, data.type);

View File

@ -928,6 +928,14 @@ function PartnerData:SortPartnerDataJson()
local new_data_list = {}
for i = 1, #data_list do
local data = data_list[i]
local extGoesShowData = {}
for k, v in pairs(data.extGoesShowData) do
if v ~= nil then
table.insert(extGoesShowData, v)
end
end
data.extGoesShowData = extGoesShowData
local new_attr = {}
new_attr["_default_"] = "0"
@ -940,6 +948,12 @@ function PartnerData:SortPartnerDataJson()
skillId = 0,
skillLv = 0
}
if data.skillData == nil then
data.skillData = {}
end
if data.skillData.unlockSkillMap == nil then
data.skillData.unlockSkillMap = {}
end
for k, v in pairs(data.skillData.unlockSkillMap) do
new_unlockSkillMap[tostring(k)] = v
end
@ -951,6 +965,12 @@ function PartnerData:SortPartnerDataJson()
new_data.attrs = new_attr
new_data.skillData = CommonUtil.TableClone(data.skillData)
new_data.skillData.unlockSkillMap = new_unlockSkillMap
if new_data.skillEquipSlot == nil then
new_data.skillEquipSlot = {}
end
if new_data.skillEquipSlot.slotList == nil then
new_data.skillEquipSlot.slotList = {}
end
for k, v in pairs(new_data.skillEquipSlot.slotList) do
v.slotAttrs["_default_"] = 0
end