源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

58 行
1.7 KiB

  1. ChildSkillAttrItem = ChildSkillAttrItem or BaseClass(BaseItem)
  2. function ChildSkillAttrItem:__init()
  3. self.base_file = "child"
  4. self.layout_file = "ChildSkillAttrItem"
  5. self.is_delay_callback = true
  6. -- self.use_local_view = true
  7. self:Load()
  8. end
  9. function ChildSkillAttrItem:Load_callback()
  10. self.nodes = {
  11. "txt_attr_name:tmp","txt_num:tmp",
  12. "img_icon:img","bg:img:obj",
  13. }
  14. self:GetChildren(self.nodes)
  15. self:InitEvent()
  16. if self.need_refreshData then
  17. self:SetData(self.attrId,self.num,self.index, self.need_effect)
  18. end
  19. end
  20. function ChildSkillAttrItem:InitEvent()
  21. end
  22. function ChildSkillAttrItem:SetData(attrId,num,index, need_effect)
  23. self.attrId = attrId or 1
  24. self.num = num or ""
  25. self.index = index
  26. self.need_effect = need_effect
  27. if self.is_loaded then
  28. self.txt_num_tmp.text = self.num
  29. local _, name1, _, val1 = WordManager:GetPropertyInfo(attrId, num)
  30. self.txt_attr_name_tmp.text = name1
  31. local ab_name,res_name = GameResPath.GetAttrIcon(attrId)
  32. lua_resM:setImageSprite(self, self.img_icon_img, ab_name,res_name,true)
  33. if self.need_effect then
  34. if not self.is_in_effect then
  35. self.is_in_effect = true
  36. local function call_back( )
  37. self.is_in_effect = false
  38. end
  39. self:ClearUIEffect(self.txt_num)
  40. self:AddUIEffect("ui_jinjieshuxing", self.txt_num, self.layer_name, Vector3(-100,0,0), 0.5, false, 0.75, nil, call_back)
  41. end
  42. end
  43. -- if index and index % 2 == 0 then
  44. -- self.bg_obj:SetActive(false)
  45. -- else
  46. -- self.bg_obj:SetActive(true)
  47. -- end
  48. else
  49. self.need_refreshData = true
  50. end
  51. end