Files
Main/Assets/GameAssets/Resources/Lua/Common/CustomLib/UIRoleSkinManager/UIRoleSkinCompoentWrap.lua
2025-01-25 04:38:09 +08:00

72 lines
2.1 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

------------------------------------------------
--作者gzg
--日期2021-03-06
--文件UIRoleSkin.lua
--模块UIRoleSkin
--描述窗体角色的Skin信息
------------------------------------------------
------------------------------------------------
--作者: gzg
--日期: 2020-02-20
--文件: UIRoleSkinCompoentWrap.lua
--模块: UIRoleSkinCompoentWrap
--描述: 示例类
--注意: 在类中的定义字段,不能赋值为nil,需要赋值为一个值.
------------------------------------------------
--引用
local L_ParentCSType = CS.Thousandto.GameUI.Form.UIRoleSkinCompoent
--在类中的定义字段,不能赋值为nil,需要赋值为一个值.默认可以为0
local UIRoleSkinCompoentWrap = {
--CS父类对象
_SuperObj_ = 0,
--这里如果定义成员,这里必须
}
--#region //类继承的固定模板
--构造函数
function UIRoleSkinCompoentWrap:New(UICompoent)
local _m = Utils.DeepCopy(self)
_m._SuperObj_ = UICompoent;
_m:_InitBindOverride_();
_m:_InitContent_();
Utils.BuildInheritRel(_m);
return _m
end
--绑定Override的方法
function UIRoleSkinCompoentWrap:_InitBindOverride_()
--重载函数的重定义
self._SuperObj_.OnDestroyDelegate = Utils.Handler(self.Free,self,nil,true)
end
--初始化
function UIRoleSkinCompoentWrap:_InitContent_()
--todo
end
function UIRoleSkinCompoentWrap:GetCSObj()
return self._SuperObj_;
end
--卸载
function UIRoleSkinCompoentWrap:Free()
self._SuperObj_.OnDestroyDelegate = nil;
UIRoleSkinManager:Remove(self._SuperObj_);
Utils.Destory(self);
end
--#endregion
--重载方法1
function UIRoleSkinCompoentWrap:RefreshPlayerSkinModel(occInt, visibleInfo, animList)
self._SuperObj_:SetEquip(FSkinPartCode.Body, visibleInfo:GetBodyModelID(occInt), animList);
self._SuperObj_:SetEquip(FSkinPartCode.GodWeaponHead, visibleInfo:GetFashionWeaponModelID(occInt));
self._SuperObj_:SetEquip(FSkinPartCode.XianjiaHuan, visibleInfo:GetFashionHaloModelID());
self._SuperObj_:SetEquip(FSkinPartCode.Wing, visibleInfo:GetFashionWingModelID(occInt));
end
return UIRoleSkinCompoentWrap