|
|
- ChildSkillAttrItem = ChildSkillAttrItem or BaseClass(BaseItem)
- function ChildSkillAttrItem:__init()
- self.base_file = "child"
- self.layout_file = "ChildSkillAttrItem"
- self.is_delay_callback = true
- -- self.use_local_view = true
- self:Load()
- end
-
- function ChildSkillAttrItem:Load_callback()
- self.nodes = {
- "txt_attr_name:tmp","txt_num:tmp",
- "img_icon:img","bg:img:obj",
-
- }
- self:GetChildren(self.nodes)
- self:InitEvent()
- if self.need_refreshData then
- self:SetData(self.attrId,self.num,self.index, self.need_effect)
- end
- end
-
- function ChildSkillAttrItem:InitEvent()
-
- end
-
- function ChildSkillAttrItem:SetData(attrId,num,index, need_effect)
- self.attrId = attrId or 1
- self.num = num or ""
- self.index = index
- self.need_effect = need_effect
- if self.is_loaded then
- self.txt_num_tmp.text = self.num
- local _, name1, _, val1 = WordManager:GetPropertyInfo(attrId, num)
- self.txt_attr_name_tmp.text = name1
-
- local ab_name,res_name = GameResPath.GetAttrIcon(attrId)
- lua_resM:setImageSprite(self, self.img_icon_img, ab_name,res_name,true)
- if self.need_effect then
- if not self.is_in_effect then
- self.is_in_effect = true
- local function call_back( )
- self.is_in_effect = false
- end
- self:ClearUIEffect(self.txt_num)
- self:AddUIEffect("ui_jinjieshuxing", self.txt_num, self.layer_name, Vector3(-100,0,0), 0.5, false, 0.75, nil, call_back)
- end
- end
-
- -- if index and index % 2 == 0 then
- -- self.bg_obj:SetActive(false)
- -- else
- -- self.bg_obj:SetActive(true)
- -- end
- else
- self.need_refreshData = true
- end
- end
|