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

45 行
1.2 KiB

StarMapPropItem = StarMapPropItem or BaseClass(BaseItem)
function StarMapPropItem:__init()
self.base_file = "starMap"
self.layout_file = "StarMapPropItem"
self:Load()
end
function StarMapPropItem:Load_callback()
self.bg = self:GetChild("bg").gameObject
self.title = self:GetChild("title"):GetComponent("Text")
self.value = self:GetChild("value"):GetComponent("Text")
self.up = self:GetChild("up").gameObject
self.up_value = self:GetChild("up/value"):GetComponent("Text")
if self.need_refreData then
self:SetData(self.attr_list,self.next_val,self.index)
end
end
function StarMapPropItem:SetData(attr_list,next_val,index)
self.attr_list = attr_list
self.next_val = next_val
self.index = index
if not self.is_loaded then self.need_refreData = true return end
self.need_refreData = false
self.title.text = WordManager:GetProperties(tonumber(attr_list.attr_type )).." : "
self.value.text = attr_list.attr_value
if next_val > 0 then
self.up:SetActive(true)
self.up_value.text = next_val
else
self.up:SetActive(false)
end
if index ~= nil and index % 2 == 0 then
self.bg:SetActive(true)
else
self.bg:SetActive(false)
end
end
function StarMapPropItem:__delete()
end