local LuaEditorDynamicDependencyProvider = {} local STAGE_UNKNOWN = -999 local STAGE_PACK_599 = 599 local STAGE_PACK_500 = 500 local STAGE_PACK_129 = 129 local UpdateTabStage = nil local CommandTheWorld_Model = require("Modules/CommandTheWorld/CommandTheWorld_Model") local function MergeDictStage(tb, result) for k,v in pairs(result) do UpdateTabStage(tb, k, v) end end local function UpdatePsGroupStage(result, name) if name then local path = string.format(ConstAssetPathConfig.PsGroupPath, name) if result[path] == nil then result[path] = STAGE_UNKNOWN end end end local function GetBattleEffectFuncList() local UpdateBuffEffectStage = function(result, intParams, floatParams, stringParam) UpdatePsGroupStage(result, stringParam) end local UpdateTimelineStage = function(result, intParams, floatParams, stringParam) result[stringParam] = STAGE_UNKNOWN end local funcList = { ReplaceBuffResourceIfFriend = UpdateBuffEffectStage, PlayPsEffect = UpdateBuffEffectStage, OriginPlayPsEffect = UpdateBuffEffectStage, PlayPsEffectByCampRelationType = UpdateBuffEffectStage, CallBySkillJoystickTargetNum = UpdateBuffEffectStage, ExcludeBuffPsEffect = UpdateBuffEffectStage, StartTimeline = UpdateTimelineStage, } return funcList end local function GetBattleEffectDynamicDependencies() local funcList = GetBattleEffectFuncList() local result = {} for _, v in DataSheetManager.BattleEffectData:GetEnumerator() do if funcList[v.funcName] then funcList[v.funcName](result, v.intParams, v.floatParams, v.stringParam) end end return result end --收集ui中对资源的调用 local function GetUILogicDynamicDependencies(ProcessModelDependency) local result = {} --沙场点兵 for i, v in ipairs(CommandTheWorld_Model.BoxLevelAndMonsterModelId) do ProcessModelDependency(v.left, result, STAGE_PACK_599) ProcessModelDependency(v.right, result, STAGE_PACK_599) end --专属服务器配置(登录可见,要在首包内) for _, v in DataSheetManager.SpecialServerTab:GetEnumerator() do result[v.GroupTabPicture] = 0 result[v.GroupTabPicture2] = 0 result[v.ServerPicture] = 0 end for _, v in DataSheetManager.NewPlayerLoginReward:GetEnumerator() do result[v.BGPicture] = 129 end return result end local function GetConstDynamicDependencies() local stageConfig = { [ConstAssetPathConfig.Pattern11] = 0, [ConstAssetPathConfig.AssetPath193] = 0, [ConstAssetPathConfig.EffectPath2] = 0, [ConstAssetPathConfig.EFFECT_CROSS_SERVER] = 0, [ConstAssetPathConfig.EFFECT_WAR_ZONE] = 0, [ConstAssetPathConfig.effect2] = 0, [ConstAssetPathConfig.DarkGoldMassBurstEffectPath] = 0, [ConstAssetPathConfig.DarkGoldMassEffectPath] = 0, [ConstAssetPathConfig.GoldMassBurstEffectPath] = 0, [ConstAssetPathConfig.WholeCardBurstEffectPath] = 0, [ConstAssetPathConfig.WholeCardMassEffectPath] = 0, [ConstAssetPathConfig.GoldMassEffectPath] = 0, [ConstAssetPathConfig.Pattern12] = 0, [ConstAssetPathConfig.AssetPath126] = 0, [ConstAssetPathConfig.AssetPath124] = 0, [ConstAssetPathConfig.AssetPath125] = 0, [ConstAssetPathConfig.AssetPath17] = 0, [ConstAssetPathConfig.AssetPath36] = 0, [ConstAssetPathConfig.AssetPath164] = 0, [ConstAssetPathConfig.AssetPath145] = 0, [ConstAssetPathConfig.Path40] = 0, [ConstAssetPathConfig.Path18] = 0, [ConstAssetPathConfig.AssetPath116] = 0, [ConstAssetPathConfig.AssetPath115] = 0, [ConstAssetPathConfig.AssetPath117] = 0, [ConstAssetPathConfig.Pattern] = 0, [ConstAssetPathConfig.EFFECT_PATH2] = 125, [ConstAssetPathConfig.AssetPath177] = 125, [ConstAssetPathConfig.BG_PATH] = 125, [ConstAssetPathConfig.AssetPath178] = 129, [ConstAssetPathConfig.EFFECT_PATH] = 129, [ConstAssetPathConfig.Buff_CityGate] = 199, [ConstAssetPathConfig.Buff_DiaoChanS1_RanXue] = 199, [ConstAssetPathConfig.Func_BossWeak] = 199, [ConstAssetPathConfig.Buff_Zengyi_CD] = 199, [ConstAssetPathConfig.EmptyLightObjPath] = 299, [ConstAssetPathConfig.PATH_EFFECT] = 299, [ConstAssetPathConfig.FOG_EFFECT_PATH] = 299, [ConstAssetPathConfig.PARADISE_SCENE_EFFECT] = 299, [ConstAssetPathConfig.flagEffectPath] = 299, [ConstAssetPathConfig.CONST_PATH_EFFECT] = 299, [ConstAssetPathConfig.EFFECT_SMALL_STATIC_BLUE] = 299, [ConstAssetPathConfig.EFFECT_SMALL_ENTER_BLUE] = 299, [ConstAssetPathConfig.EFFECT_SMALL_STATIC_RED] = 299, [ConstAssetPathConfig.EFFECT_SMALL_ENTER_RED] = 299, [ConstAssetPathConfig.EFFECT_BIG_STATIC_BLUE] = 299, [ConstAssetPathConfig.EFFECT_BIG_ENTER_BLUE] = 299, [ConstAssetPathConfig.EFFECT_BIG_STATIC_RED] = 299, [ConstAssetPathConfig.EFFECT_BIG_ENTER_RED] = 299, [ConstAssetPathConfig.DyeBgPath] = 599, } local result = {} for k, v in pairs(ConstAssetPathConfig) do if type(v) == "string" then if stageConfig[v] then result[v] = stageConfig[v] else result[v] = STAGE_UNKNOWN end end end --相对路径的特效 for k, v in pairs(ConstAssetPathConfig.RelativeEffect) do local path = string.format(ConstAssetPathConfig.PsGroupPath, v) if stageConfig[path] then result[path] = stageConfig[path] else result[path] = STAGE_UNKNOWN end end return result end local function GetPsGroupStageDynamicDependencies() local result = {} for _, v in DataSheetManager.MissileData:GetEnumerator() do UpdatePsGroupStage(result, v.PSMissileResource) UpdatePsGroupStage(result, v.HitResource) UpdatePsGroupStage(result, v.HitScreenResource) end for _, v in DataSheetManager.TrackerData:GetEnumerator() do UpdatePsGroupStage(result, v.PSMissileResource) UpdatePsGroupStage(result, v.HitResource) UpdatePsGroupStage(result, v.HitScreenResource) end for _, v in DataSheetManager.BuffData:GetEnumerator() do UpdatePsGroupStage(result, v.BuffResource) UpdatePsGroupStage(result, v.QueueResource) end --天命系统的光球特效资源,进入分包5 for _, v in DataSheetManager.MagicWeaponForgeSoulEffect:GetEnumerator() do result[v.SkillEffect] = STAGE_PACK_500 result[v.SkillEffect2] = STAGE_PACK_500 end --装饰系统的点击特效资源,进入分包1 for _, v in DataSheetManager.Decorate:GetEnumerator() do if v.Type == 2 then --点击特效 result[v.Resource] = STAGE_PACK_129 end end --TODO:坐骑系统当前的特效资源是通过命名去匹配的,后续需要优化 --目前先通过扫描配置将无法匹配到的资源带进包内 for _, v in DataSheetManager.HorseModelData:GetEnumerator() do if v.HorseEffect ~= "" then result[v.HorseEffect] = STAGE_UNKNOWN end if v.HorseShowEffect ~= "" then result[v.HorseShowEffect] = STAGE_UNKNOWN end end return result end function LuaEditorDynamicDependencyProvider.GetDynamicDependencies(updateTabStage, processModelDependency) UpdateTabStage = updateTabStage local result = {} local battleEffectResult = GetBattleEffectDynamicDependencies() MergeDictStage(result, battleEffectResult) local constResult = GetConstDynamicDependencies() MergeDictStage(result, constResult) local psGroupStageResult = GetPsGroupStageDynamicDependencies() MergeDictStage(result, psGroupStageResult) local uiLogicResult = GetUILogicDynamicDependencies(processModelDependency) MergeDictStage(result, uiLogicResult) return result end return LuaEditorDynamicDependencyProvider