FuncOpenModel = FuncOpenModel or BaseClass(BaseVo, true) FuncOpenModel.ModelTypeId = { Fashion = 1,--有人物模型类型 Skin = 2,--普通单独模型类型 Other = 3,--特殊类型 } --称号/头像/气泡 FuncOpenModel.DressTypeId = { Design = 1, Head = 2,--头像框 Pupple = 3, RoleHead = 4,--人物头像 } FuncOpenModel.TypeId = { --人物 Clothes = 1,--衣服 Weapon = 2,--武器 Head = 3,--发型 wing = 4,--背部 Hat = 5,--头饰 RoleLight = 8,--人物幻光 --单独模型 FHorse = 1001,--座驾 FWing = 1002,--炫翼 FPearl = 1003,--宝具 FWeapon = 1004,--武器 FJarvis = 1005,--AI娘 FGun = 1006,--磁炮 FCloud = 1007,--星翼 FArmour = 1008,--幻甲 Galaxy = 1009, --星辰 Psionic = 1010,--灵能 God = 1011,--神作 Monster = 1101,--怪物1 Pet = 1201,--宠物 Light = 1301,--幻光 Equip = 1401,--装备 Evil = 1501,--守护 Child = 1601,-- 孩子/宝宝 WarSoul = 1701,--战魂 OtherGoods = 1801,--其他模型 ChildVehicle = 1901, -- 宝宝的载具 ChildInVehicle = 2001, -- 宝宝的载具(有个宝宝骑乘) } function FuncOpenModel:__init() FuncOpenModel.Instance = self self.func_data_list = {} --触发功能数据 --打开功能界面的条件,必须等到 RightBottom 跟ActivityIconManager 都发送完OPEN_FUNC_OPEN_VIEW 才符合条件 self.open_condition_list = {} self.cur_down_load = 0--当前下载进度 self.cookies_list = {} --功能开放 end function FuncOpenModel:getInstance() if FuncOpenModel.Instance == nil then FuncOpenModel.New(); end return FuncOpenModel.Instance; end --清除缓存数据 function FuncOpenModel:ClearData() self.func_data_list = {} --触发功能数据 self.open_condition_list = {} end --返回模型类型 2 是fashion 1 是skin function FuncOpenModel:ReturnModelType( fashion_type ) if fashion_type <= 1000 then--代表有人物模型 return FuncOpenModel.ModelTypeId.Fashion else return FuncOpenModel.ModelTypeId.Skin end end function FuncOpenModel:IsFosterType( fashion_type ) if fashion_type >= 1001 and fashion_type <= 1008 then return true end return false end function FuncOpenModel:GetTempVo( ) local temp_vo = { help_type = 0, ignore_fly = false, type = 0, id = 0, tabId = 0, model_res = 0, model_type = 0, desc = "", saying = "", winId = 0, subId = 0, } return temp_vo end --检测是否有前置条件 function FuncOpenModel:DealWithFuncOpenHelperVo(helpVo) local voList = {} local tempTabId if helpVo then local vo local list = ErlangParser:GetInstance():Parse(helpVo.param) -- print("huangcong:FuncOpenModel [start:50] list:", list) -- PrintTable(list) -- print("huangcong:FuncOpenModel [end]") for index,value in ipairs(list) do vo = self:GetTempVo() vo.help_type = helpVo.help_type vo.ignore_fly = helpVo.ignore_fly vo.type = tonumber(value[1]) vo.id = tonumber(value[2]) vo.tabId = value[3] and tonumber(value[3]) or 0 vo.fashion_type = value[4] and tonumber(value[4]) or 0 vo.figure_id = value[5] and tonumber(value[5]) or 0 vo.icon_res_name = helpVo.icon_res_name tempTabId = tempTabId or vo.tabId vo.desc = helpVo.desc or "" vo.saying = helpVo.saying or "" vo.winId = helpVo.winId vo.subId = helpVo.subId vo.sound = helpVo.sound and Config.ConfigSound.Tip[helpVo.sound] or "" vo.name = helpVo.name or "" table.insert(voList,vo) end end return voList, tempTabId end --检测是否有新功能开放 右上角 function FuncOpenModel:HasNewTopFuncOpen(helpVo) if helpVo then local voList = self:DealWithFuncOpenHelperVo(helpVo) for k,vo in pairs(voList) do if vo.type == 1 then local cfg = ActivityIconManager:getInstance():getIconCfg(vo.id) if cfg then return true end end end end return false end --检测是否有新功能开放 左下角 function FuncOpenModel:HasNewBottomFuncOpen(helpVo) if helpVo then local voList = self:DealWithFuncOpenHelperVo(helpVo) for k,vo in pairs(voList) do if vo.type == 4 then return true end if vo.type == 3 then local cfg = MainUIModel:getInstance():getFuncIconCfg(vo.id) if cfg then return true end end end end return false end --检测是否有新技能开放 技能 function FuncOpenModel:HasNewSkillFuncOpen(helpVo) if helpVo then local voList = self:DealWithFuncOpenHelperVo(helpVo) for k,vo in pairs(voList) do if vo.type == 2 then return true end end end return false end --右上角需要隐藏图标 function FuncOpenModel:TryNewHideTopFuncIcon(helpVo) local voList, tabId = self:DealWithFuncOpenHelperVo(helpVo) if not helpVo.ignore_hide_icon then GlobalEventSystem:Fire(EventName.HIDE_FUNC_OPEN_ICON,voList) end end --左下角需要隐藏图标 function FuncOpenModel:TryNewHideBottomFuncIcon(helpVo) local voList, tabId = self:DealWithFuncOpenHelperVo(helpVo) if not helpVo.ignore_hide_icon then GlobalEventSystem:Fire(EventName.HIDE_FUNC_OPEN_ICON,voList) end end --技能需要隐藏图标 function FuncOpenModel:TryNewHideSkillFuncIcon(helpVo) local voList = self:DealWithFuncOpenHelperVo(helpVo) GlobalEventSystem:Fire(EventName.HIDE_FUNC_OPEN_ICON,voList) end --添加功能开放数据 function FuncOpenModel:AddFuncOpenDataVo(vo) if self.func_data_list then table.insert( self.func_data_list, vo) end end function FuncOpenModel:SetOpenCondition(key) if self.open_condition_list then self.open_condition_list[key] = true end end function FuncOpenModel:ClearOpenCondition() self.open_condition_list = {} end function FuncOpenModel:HasFuncOpenCondition() if self.open_condition_list then return self.open_condition_list["ActivityIconManager"] and self.open_condition_list["RightBottomView"] and self.open_condition_list["TaskTeamView"] end return false end function FuncOpenModel:ClearOpenFuncData() self.func_data_list = {} end --检测是否有结婚新功能开放 function FuncOpenModel:HasNewMarriageFuncOpen(helpVo) if helpVo then local voList = self:DealWithFuncOpenHelperVo(helpVo) for k,vo in pairs(voList) do if vo.type == 4 then --结婚 return true end end end return false end --得到图标需要飞的坐标 function FuncOpenModel:GetFlyPos( curVo ) local pos = Vector3.zero if curVo.type == 1 then--右上角图标位置 if curVo.winId == 157 and curVo.subId == 0 then--主线任务,在经验副本下面 pos = MainUIController:GetInstance():GetExpPos() pos.x = pos.x + 50 pos.y = pos.y - 90 elseif curVo.winId == 610 and curVo.subId == 2 then--经验快车在主界面左上角 pos = MainUIController:GetInstance():GetExpPos() elseif curVo.winId == 145 and curVo.subId == 0 then--装备套装收集在背包 pos = MainUIController:GetInstance():GetBagBtnWorldPos() elseif curVo.winId == 450 and curVo.subId == 22 then--装备套装收集在左上角 if MainUIController.Instance.MainRoleHeadInfoView then pos = MainUIController.Instance.MainRoleHeadInfoView:GetRechargeBtnPos() end else pos = ActivityIconManager:getInstance():GetActivityIconPos(curVo.id) end elseif curVo.type == 2 then--普通技能 pos = MainUIController:GetInstance():GetSkillBtnPos(curVo.id) elseif curVo.type == 3 then--右下角图标位置 pos = MainUIController:GetInstance():GetRightButtonWorldPos(curVo.id) elseif curVo.type == 4 then--背包位置 pos = MainUIController:GetInstance():GetBagBtnWorldPos() elseif curVo.type == 6 then--支线任务任务栏位置 pos = MainUIController:GetInstance():GetTaskBranceLinePos() elseif curVo.type == 7 then--右上角幻魔位置 pos = MainUIController:GetInstance():GetBossBtnPos(curVo.id) end return pos end --加载所有模型以下必传参数father_node, transform,fashion_type,【figure_id(怪物可不传)】 --data.father_node[加载模型的父节点] --data.transform[加载模型的节点] --data.fashion_type--资源类型 --data.figure_id[资源id] --data.scale[缩放] --data.position[坐标] --data.can_rotate[能否旋转] --data.rotate[旋转角度] --data.show_shadow[是否展示阴影] --data.use_bloom[使用泛光效果] --data.action_name_list[动作列表] --data.ui_model_type[使用哪种接口展示模型] --data.role_vo[是否使用别人玩家的数据] --data.fashion_color[时装变色] --data.clothe_res_id[怪物模型使用,如果不传figure_id则需要传clothe_res_id来做模型资源id] function FuncOpenModel:SetModelRes( res_data ) if not self.mainVo then self.mainVo = RoleManager.Instance.mainRoleInfo end if not res_data or not res_data.transform then return end ------------------------- --清除挂接的UI特效 if res_data.father_node and res_data.transform then res_data.father_node:ClearUIEffect( res_data.transform ) end ------------------------- local model_type = self:ReturnModelType(res_data.fashion_type) if model_type == FuncOpenModel.ModelTypeId.Fashion then--人物模型类 self:SetFashion(res_data) elseif model_type == FuncOpenModel.ModelTypeId.Skin then-- 单独模型 self:UpdateSkin(res_data) end end --传入角色id,会向后端请求该角色的形象信息,以下参数一定要有!!!!其他参数支持自定义,具体参考上面方法注释 --data.father_node[加载模型的父节点] --data.transform[加载模型的节点] --data.fashion_type--资源类型 function FuncOpenModel:SetRoleModelByID(role_id, data) if role_id == RoleManager.Instance.mainRoleInfo.role_id then--自己的话就不用去拿数据了 直接照传data进去就好 self:SetModelRes(data) else local call_back = function ( vo ) data.role_vo = vo self:SetModelRes(data) end GlobalEventSystem:Fire(EventName.REQ_ROLE_INFO, role_id, call_back) end end function FuncOpenModel:SetFashion( res_data ) --得到当前人物的时装和颜色 local fashion_model_id, fashion_texture_id = self.mainVo:GetRoleClotheTextureId() local weapon_model_id, weapon_texture_id = self.mainVo:GetWeaponClotheId() local head_model_id,head_clothe_id = self.mainVo:GetRoleHeadId() local footmark_id = self.mainVo:GetRoleFootmarkId() local wing_id = self.mainVo:GetRoleWingId() local career = self.mainVo.career local clothe_res_id = self.mainVo:GetRoleClotheId() local hat_wear_id = self.mainVo:GetRoleHatId() local image_id = self.mainVo.image_id local light_id = res_data.light_id local talisman_id = res_data.talisman_id local ui_model_type = res_data.ui_model_type or UIModelCommon.ModelType.Model local free_param = res_data.free_param -- 人物模型带载具专用参数 res_data.type 同时需要改成SceneBaseType.Include_Horse local type_pos = FuncOpenModel.TypeId.Clothes if res_data.fashion_type == FuncOpenModel.TypeId.Clothes then --衣服 type_pos = FashionPartPos.Clothe elseif res_data.fashion_type == FuncOpenModel.TypeId.Weapon then --武器 type_pos = FashionPartPos.Weapon elseif res_data.fashion_type == FuncOpenModel.TypeId.Head then --头饰 type_pos = FashionPartPos.Head elseif res_data.fashion_type == FuncOpenModel.TypeId.Footprint then --足迹 type_pos = FashionPartPos.Footmark elseif res_data.fashion_type == FuncOpenModel.TypeId.wing then --背部 type_pos = FashionPartPos.wing elseif res_data.fashion_type == FuncOpenModel.TypeId.Hat then--头套 type_pos = FashionPartPos.Hat elseif res_data.fashion_type == FuncOpenModel.TypeId.RoleLight then--人物幻光 type_pos = FashionPartPos.light end local sex = RoleManager.Instance.mainRoleInfo.sex if res_data.role_vo then wing_id = GetWingClotheId(res_data.role_vo) clothe_res_id = GetRoleClotheId(res_data.role_vo.level_model_list) fashion_model_id, fashion_texture_id = GetRoleClotheTextureId(res_data.role_vo) weapon_model_id, weapon_texture_id = GetWeaponClotheId(res_data.role_vo) head_model_id, head_clothe_id = GetRoleHeadId(res_data.role_vo) hat_model_id = GetRoleHatId(res_data.role_vo) -- footmark_id = GetRoleFootmarkId(res_data.role_vo) image_id = res_data.role_vo.image_id sex = res_data.role_vo.sex or sex hat_wear_id = GetRoleHatId(res_data.role_vo) end local color = res_data.figure_texture or fashion_texture_id local figure_id = res_data.figure_id and tonumber(res_data.figure_id) or fashion_model_id if figure_id then if type_pos ~= FashionPartPos.wing and type_pos ~= FashionPartPos.Hat and type_pos ~= FashionPartPos.light then if career then if (res_data.fashion_type == FuncOpenModel.TypeId.Clothes or res_data.fashion_type == FuncOpenModel.TypeId.Head) and figure_id > 100000 then --时装和头饰可以变色(判断id是否是大于10W的) figure_id = (math.floor(figure_id/100000) + career * 1000)..(figure_id%100000) else if figure_id < 1000 then figure_id = figure_id + career * 1000 end end end else figure_id = figure_id end end if type_pos == FashionPartPos.Clothe then fashion_model_id = figure_id or fashion_model_id fashion_texture_id = color elseif type_pos == FashionPartPos.Weapon then weapon_model_id = figure_id or weapon_model_id weapon_texture_id = color elseif type_pos == FashionPartPos.Head then head_model_id = figure_id or head_model_id head_clothe_id = color elseif type_pos == FashionPartPos.wing then wing_id = figure_id elseif type_pos == FashionPartPos.light then light_id = figure_id elseif type_pos == FashionPartPos.Hat then hat_wear_id = figure_id end if res_data.weapon_res_id and res_data.weapon_res_id == "nil" then -- 空手 weapon_model_id = nil end if res_data.wing_res_id and res_data.wing_res_id == "nil" then -- 空手 wing_id = nil end res_data.career = career res_data.clothe_res_id = res_data.clothe_res_id or clothe_res_id res_data.weapon_res_id = res_data.weapon_res_id or weapon_model_id res_data.weapon_clothe_id = res_data.weapon_clothe_id or weapon_texture_id res_data.type = res_data.type and res_data.type == SceneBaseType.Include_Horse and res_data.type or SceneBaseType.MainRole res_data.fashion_model_id = res_data.fashion_model_id or fashion_model_id res_data.texture_id = res_data.texture_id or fashion_texture_id res_data.wing_id = res_data.wing_id or wing_id res_data.image_id = res_data.image_id or image_id res_data.head_wear_id = res_data.head_wear_id or head_model_id res_data.head_clothe_id = res_data.head_clothe_id or head_clothe_id res_data.light_id = res_data.light_id or light_id res_data.talisman_id = res_data.talisman_id or talisman_id res_data.hat_wear_id = res_data.hat_wear_id or hat_wear_id res_data.free_param = res_data.free_param or free_param local data = lua_resM:ModelDataDefineVar(res_data) -- print("huangcong:FuncOpenModel [start:388] res_data:", res_data) -- PrintTable(res_data) -- print("huangcong:FuncOpenModel [end]") -- 强制不显示翅膀(红装之路) if res_data.force_hide_wing then res_data.wing_id = nil end if ui_model_type == UIModelCommon.ModelType.RT then--是否使用rt data.wing_id = nil--翅膀特效暂时无法正常显示 lua_resM:SetRoleModelByRT(res_data.father_node, res_data.transform, data) elseif ui_model_type == UIModelCommon.ModelType.BackModel then lua_resM:SetBackRoleModel(res_data.father_node, res_data.transform, data) else lua_resM:SetRoleModel(res_data.father_node, res_data.transform, data) end end function FuncOpenModel:UpdateSkin( res_data ) local ui_model_type = res_data.ui_model_type or UIModelCommon.ModelType.Model figure_id = figure_id and tonumber(res_data.figure_id) or 1001 local data = nil if self:IsFosterType(res_data.fashion_type) then--进阶模型 data = self:GetFosterModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Monster then -- 怪物模型 data = self:GetMonsterModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Light then -- 幻光模型 self:ShowLightModel(res_data) return elseif res_data.fashion_type == FuncOpenModel.TypeId.Psionic then -- 灵能模型 self:ShowPsionicModel(res_data) return elseif res_data.fashion_type == FuncOpenModel.TypeId.Pet then -- 宠物模型 data = self:GetPetModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Equip then--装备模型 data = self:GetEquipModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Evil then--守护模型 data = self:GetEvilModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Child then --宝宝模型 data = self:GetChildModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.ChildVehicle then --宝宝载具 data = self:GetChildVehicleModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.ChildInVehicle then --宝宝载具(有宝宝骑) data = self:GetChildInVehicleModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.WarSoul then --战魂模型 data = self:GetWarSoulModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.Galaxy then --星辰 data = self:GetGalaxyModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.God then --神座 data = self:GetGodModelData(res_data) elseif res_data.fashion_type == FuncOpenModel.TypeId.OtherGoods then data = self:GetOtherGoodsModelData(res_data) end if not data then print("不存在数据:",res_data.fashion_type) return end -- 通用绿幕的添加 data.use_green_screen = res_data.use_green_screen data.green_screen_camera_type = res_data.green_screen_camera_type ------------------------- if ui_model_type == UIModelCommon.ModelType.RT then--是否使用rt lua_resM:SetRoleModelByRT(res_data.father_node, res_data.transform, data) elseif ui_model_type == UIModelCommon.ModelType.BackModel then lua_resM:SetBackRoleModel(res_data.father_node, res_data.transform, data) else lua_resM:SetRoleModel(res_data.father_node, res_data.transform, data) end end function FuncOpenModel:GetFosterModelData( res_data ) if not res_data then return end local show_type = res_data.fashion_type - 1000 local figure_id = res_data.figure_id if not res_data.action_name_list then if show_type == FosterConst.ModuleId.FWeapon then res_data.action_name_list = {"show3"} elseif show_type == FosterConst.ModuleId.FWing or show_type == FosterConst.ModuleId.FCloud or show_type == FosterConst.ModuleId.FGun or show_type == FosterConst.ModuleId.FArmour then res_data.action_name_list = {"show"} else res_data.action_name_list = {"show2","show"} end end ------------------------- local show_conf = FosterConst.ModelShowConfig[show_type][figure_id] or FosterConst.ModelShowConfig[show_type][0] if show_type == FosterConst.ModuleId.FWeapon then --武器的比较特殊 show_conf = FosterConst.ModelShowConfig[show_type][GameResPath:GetFWeaponResName( res_data.career,figure_id )] or FosterConst.ModelShowConfig[show_type][0] end ------------------------- local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = figure_id data.can_rotate = data.can_rotate == nil and show_type ~= FosterConst.ModuleId.FWeapon or data.can_rotate data.type = FosterConst.ModelMatch[show_type] data.rotate = data.rotate or Vector3(show_conf.rotate[1],show_conf.rotate[2],show_conf.rotate[3]) data.raycast_size = data.raycast_size or Vector2(340,460) ------------------------- if data.ui_model_type ~= UIModelCommon.ModelType.BackModel then if show_type == FosterConst.ModuleId.FHorse then if not (type(data.rotate) == "number") then--加个参数类型判断 data.rotate.x = data.rotate.x + 15 end end ------------------------- if not data.scale then if FosterConst.ModelSpecialShowConfig[show_type] and FosterConst.ModelSpecialShowConfig[show_type][figure_id] then --部分需要特殊配置的 local temp_conf = FosterConst.ModelSpecialShowConfig[show_type][figure_id] if temp_conf.scale then data.scale = temp_conf.scale end end end ------------------------- if not data.position then if FosterConst.ModelSpecialShowConfig[show_type] and FosterConst.ModelSpecialShowConfig[show_type][figure_id] then --部分需要特殊配置的 local temp_conf = FosterConst.ModelSpecialShowConfig[show_type][figure_id] if temp_conf.position then data.position = Vector3(temp_conf.position[1],temp_conf.position[2],temp_conf.position[3]) end else data.position = Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) end ------------------------- --配置里面的坐标和尺寸,是backmodel下的,其它模式的话要转换一下吧 data.position.z = -500 local chang_y = -200 if show_type == FosterConst.ModuleId.FPearl or show_type == FosterConst.ModuleId.FWeapon or show_type == FosterConst.ModuleId.FGun or show_type == FosterConst.ModuleId.FCloud then chang_y = -250 elseif show_type == FosterConst.ModuleId.FArmour then chang_y = -250 end local chang_x = 0 local career = data.career or RoleManager.Instance.mainRoleInfo.career if show_type == FosterConst.ModuleId.FWeapon then if career == 2 or career == 1 then chang_x = -50 end end data.position.y = data.position.y + chang_y data.position.x = data.position.x + chang_x end end data.position = data.position or Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) data.scale = data.scale or show_conf.scale or 120 ------------------------- return data end --获得怪物模型数据 function FuncOpenModel:GetMonsterModelData( res_data ) if not res_data then return nil end local mon_cfg, model_id if res_data.figure_id then -- 如果传入了怪物id,则优先使用怪物id对应的模型资源id mon_cfg = ConfigItemMgr.Instance:GetMonsterDataItem(res_data.figure_id) model_id = mon_cfg.icon elseif res_data.clothe_res_id then model_id = res_data.clothe_res_id end if not model_id then print("Saber:FuncOpenModel [430] 不存在模型id: ",debug.traceback()) end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = model_id data.type = SceneBaseType.Monster data.scale = res_data.scale or 120 data.rotate = res_data.rotate or Vector2(0, 0) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.position = res_data.position or Vector2(0, 100) return data end --获得宠物模型数据 function FuncOpenModel:GetPetModelData(res_data) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) local show_conf = PetConst.ModelShowConfig[res_data.figure_id] or PetConst.ModelShowConfig[1001] data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Pokemon data.scale = res_data.scale or show_conf.scale data.rotate = res_data.rotate or Vector3(show_conf.rotate[1],show_conf.rotate[2],show_conf.rotate[3]) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show2","show"} data.position = res_data.position or Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) return data end function FuncOpenModel:GetOtherGoodsModelData(res_data) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.OtherGoods data.scale = res_data.scale or 150 data.rotate = res_data.rotate or Vector3(0,0,0) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or Vector3(0,0,-500) return data end -- 获取宝宝模型数据 function FuncOpenModel:GetChildModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) local show_conf = ChildConst.ModelShowConfig[1011] -- 默认模型 data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Baby data.scale = res_data.scale or show_conf.scale data.rotate = res_data.rotate or Vector3(show_conf.rotate[1],show_conf.rotate[2],show_conf.rotate[3]) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show2","show"} data.position = res_data.position or Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) return data end -- 获取宝宝载具数据 function FuncOpenModel:GetChildVehicleModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) local show_conf = ChildConst.VehicleConfig[1001] -- 默认模型 data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Baby_Horse data.scale = res_data.scale or show_conf.scale data.rotate = res_data.rotate or Vector3(show_conf.rotate[1],show_conf.rotate[2],show_conf.rotate[3]) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"idle"} data.position = res_data.position or Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) return data end -- 获取宝宝载具数据 (默认有个男娃在骑) function FuncOpenModel:GetChildInVehicleModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) local show_conf = ChildConst.ModelInVehicle -- 默认数据 data.free_param = res_data.figure_id data.clothe_res_id = res_data.clothe_res_id or 1021 data.type = SceneBaseType.Baby_Include_Horse -- 比较特殊 scale不宜太大 local scale = res_data.scale or show_conf.scale scale = Mathf.Clamp(scale, 5, 6) data.scale = scale data.rotate = res_data.rotate or -50 data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"idle"} data.position = res_data.position or Vector3(show_conf.position[1],show_conf.position[2],show_conf.position[3]) return data end --获得装备模型数据 function FuncOpenModel:GetEquipModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Equip data.scale = res_data.scale or 120 data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or Vector3(0,100,0) return data end --获得战魂模型数据 function FuncOpenModel:GetWarSoulModelData( res_data ) if not res_data then return nil end local figure_id = res_data.figure_id local effect_id = nil if figure_id >= 1000000 then effect_id = figure_id - math.floor(figure_id/1000)*1000 figure_id = math.floor(figure_id/1000) end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = figure_id local config = WarSoulConst.WarSoulModelPosCfg[figure_id] data.type = SceneBaseType.WarSoul data.scale = res_data.scale and (res_data.scale) or (config and config.scale or 120) data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or (config and config.pos) or Vector3(0,0,0) if not res_data.warSoul_effect_res and effect_id then res_data.warSoul_effect_res = "effect_egg_00"..effect_id if effect_id < 10 then res_data.warSoul_effect_res = "effect_egg_000"..effect_id end end local effect_pos_cfg = WarSoulConst.WarSoulEffectPosCfg[res_data.warSoul_effect_res] if config and effect_pos_cfg and effect_pos_cfg then data.warSoul_effect_scale = effect_pos_cfg.scale or 1 data.warSoul_effect_res = res_data.warSoul_effect_res data.warSoul_effect_pos = effect_pos_cfg.pos or Vector3.zero end return data end --获得星辰型数据 function FuncOpenModel:GetGalaxyModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Galaxy data.scale = res_data.scale or 120 data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or Vector3(0,100,0) return data end --获得神作型数据 function FuncOpenModel:GetGodModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.God data.scale = res_data.scale or 120 data.raycast_size = res_data.raycast_size or Vector2(340,460) data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or Vector3(0,100,0) if GodConst.Model_Param[res_data.figure_id] then local cfg = GodConst.Model_Param[res_data.figure_id] if cfg.pos_offset then local rate = data.scale / 100 data.position = data.position + cfg.pos_offset * rate end end return data end --获得守护模型数据 function FuncOpenModel:GetEvilModelData( res_data ) if not res_data then return nil end local data = lua_resM:ModelDataDefineVar(res_data) data.clothe_res_id = res_data.figure_id data.type = SceneBaseType.Galaxy data.scale = res_data.scale or 150 data.action_name_list = res_data.action_name_list or {"show"} data.position = res_data.position or Vector3(0,0,0) return data end --幻光比较特殊,只是一个特效 function FuncOpenModel:ShowLightModel( res_data ) if not res_data then return end local config = { uiTranform = res_data.transform, layer_name = res_data.layer_name, resname = LightModel:GetInstance():GetLightResById( (res_data.light_id) or (res_data.figure_id) ), scale = res_data.scale or 1.5, pos = res_data.position or Vector3.zero, is_loop = true, } if res_data.father_node and res_data.transform then local ref_info = lua_resM.role_mode_list[res_data.father_node] or {}--幻光这边要清一次模型 local curr_roleModel = ref_info[res_data.transform] if curr_roleModel then curr_roleModel:DeleteMe() ref_info[res_data.transform] = nil end res_data.father_node:ClearUIEffect( res_data.transform ) res_data.father_node:CreateUIEffect( config ) end end --灵能比较特殊,只是一个特效 function FuncOpenModel:ShowPsionicModel( res_data ) if not res_data then return end local config = { uiTranform = res_data.transform, layer_name = res_data.layer_name, resname = PsionicModel:getInstance():GetPsionicEffectStageByid( res_data.figure_id or 1 ), scale = res_data.scale or 270, pos = res_data.position or Vector3.zero, is_loop = true, position = Vector3(0,-15,0), } print('Cat:FuncOpenModel.lua[702] data', res_data.father_node, res_data.transform) if res_data.father_node and res_data.transform then res_data.father_node:ClearUIEffect( res_data.transform ) res_data.father_node:CreateUIEffect( config ) end end function FuncOpenModel:SaveFightChange( old_fightNum ) -- 为战力提升界面先存储旧战力数字 self.old_fightNum = old_fightNum end --通用展示称号--节点建议直接从KfActivityRushRankView复制过来 --local data = { --parent = parent, --dress_id = dress_id, --designationImg = designationImg, --scale = scale, --} function FuncOpenModel:ShowDesign( data ) if not data or not data.dress_id or not data.designationImg or not data.parent then print("huangcong:FuncOpenModel [start:761] 称号节点数据不完整:") return end local goods_id = data.dress_id or nil if not goods_id then return end local designation_id = DesignationModel:GetInstance():GetDesignationIdByGoodsId(goods_id) local dsgt_cfg = Config.Dsgt --这里构造称号需要的节点 local parent = data.parent local designation_con = data.designation_con local designationImg = data.designationImg local designationImg_img = designationImg:GetComponent("Image") if parent.dynamic_image_obj then parent.dynamic_image_obj:SetActive(false) end local designation_scale = data.scale and data.scale or 1.5 SetLocalScale(designationImg, designation_scale, designation_scale, designation_scale) cc.ActionManager:getInstance():removeAllActionsFromTarget(designationImg.transform) if dsgt_cfg[designation_id] then if dsgt_cfg[designation_id].type == 1 then--文字称号(文字称号也用图片了) designationImg.gameObject:SetActive(true) lua_resM:setOutsideImageSprite(parent, designationImg_img, GameResPath.GetDesignImage(dsgt_cfg[designation_id].id), true) elseif dsgt_cfg[designation_id].type == 2 then--图片称号 designationImg.gameObject:SetActive(true) lua_resM:setOutsideImageSprite(parent, designationImg_img, GameResPath.GetDesignImage(dsgt_cfg[designation_id].id), true) elseif dsgt_cfg[designation_id].type == 3 then--特效称号 if not parent.dynamic_image_obj then parent.dynamic_image_obj = UiFactory.createChild(designationImg, UIType.Image, "dynamic_image") dynamic_image_img = parent.dynamic_image_obj:GetComponent("Image") SetAnchoredPosition(parent.dynamic_image_obj.transform, 0, 0) else parent.dynamic_image_obj:SetActive(true) end designationImg.gameObject:SetActive(true) local data = DesignationModel:GetInstance():GetDynamicDesignationCFG(designation_id) local res = Split(data[1].res, "_")--分割出来配置 然后取文字 local font_res = res[1] or "" lua_resM:setImageSprite(parent, dynamic_image_img, data[1].ab, font_res.."_font", true) local action = cc.Animation.New(data,0.15) cc.ActionManager:getInstance():addAction(cc.RepeatForever.New(action), designationImg.transform) end end end --通用展示气泡 --节点建议直接从KfActivityRushRankView复制过来 --local data = { --parent = parent, --dress_id = dress_id, --bubbleCon = bubbleCon, --} function FuncOpenModel:ShowBubble( data ) if not data or not data.parent then return end if data.dress_id then lua_resM:setOutsideImageSprite(data.parent, data.bubbleCon:GetComponent("Image"), GameResPath.GetChatDressIcon(data.dress_id), false) end end --通用展示头像框 --节点建议直接从KfActivityRushRankView复制过来 --local data = { --parent = parent, --dress_id = dress_id, --mainRoleHeadItem = mainRoleHeadItem, --} function FuncOpenModel:ShowHead( data ) if not data or not data.parent or not data.mainRoleHeadItem then return end local head_data = { vo = {id = RoleManager.Instance.mainRoleInfo.role_id, use_bg = 3, career = 0, sex = RoleManager.Instance.mainRoleInfo.sex, turn = RoleManager.Instance.mainRoleInfo.turn, dress_board_id = data.dress_id, profile_photo_id = RoleManager.Instance.mainRoleInfo.profile_photo_id}, } data.mainRoleHeadItem:SetData(head_data) end --通用展示头像 --节点建议直接从KfActivityRushRankView复制过来 --local data = { --parent = parent, --dress_id = dress_id, --mainRoleHeadItem = mainRoleHeadItem, --} function FuncOpenModel:ShowRoleHead( data ) if not data or not data.parent or not data.mainRoleHeadItem then return end local head_data = { vo = {id = RoleManager.Instance.mainRoleInfo.role_id, use_bg = 3, career = 0, sex = RoleManager.Instance.mainRoleInfo.sex, turn = RoleManager.Instance.mainRoleInfo.turn, dress_board_id = RoleManager.Instance.mainRoleInfo.dress_board, profile_photo_id = data.dress_id}, } data.mainRoleHeadItem:SetData(head_data) end