属性图标修改

dev_chengFeng
jiaoyangna 2021-02-19 17:50:10 +08:00
parent 56f68bd9a2
commit 05e1eceb99
4 changed files with 32 additions and 13 deletions

View File

@ -75,9 +75,10 @@ function this.GetShowPanelData()
for key, value in pairs(allAddProVal) do
index = index + 1
if proList[index] then
--LogGreen(key.." "..ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon.." "..GetResourcePath(ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon) )
Util.GetGameObject(proList[index].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
Util.GetGameObject(proList[index].transform,"proValue"):GetComponent("Text").text = value
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index + 1])
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon))
end
end
-- for i = 1, 4 do
@ -113,9 +114,10 @@ function this.NoGetShowPanelData()
for key, value in pairs(allAddProVal) do
index = index + 1
if proList[index] then
--LogGreen(key.." "..ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon.." "..GetResourcePath(ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon) )
Util.GetGameObject(proList[index].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
Util.GetGameObject(proList[index].transform,"proValue"):GetComponent("Text").text = value
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index + 1])
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).PropertyIcon))
end
end
-- for i = 1, 4 do

View File

@ -175,7 +175,7 @@ function this.GetSinglePokemonAddProData(_did,_star)--_star 传值的话就用
local curPokemonLvConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalLevel,"Quality",curPokemonConFig.Quality,"Level",curPokeonData.lv)
local curPokemonStarConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalStar,"Quality",curPokemonConFig.Quality,"Star",_star and _star or curPokeonData.star)
--基础
addAllProVal[HeroProType.Hp] = curPokemonConFig.Hp
addAllProVal[HeroProType.Hp] = curPokemonConFig.Hp
addAllProVal[HeroProType.Attack] = curPokemonConFig.Attack
addAllProVal[HeroProType.PhysicalDefence] = curPokemonConFig.PhysicalDefence
addAllProVal[HeroProType.MagicDefence] = curPokemonConFig.MagicDefence

View File

@ -20,6 +20,7 @@ local parent
local isMaterial = 0--升级材料是否充足
local isLvEnd = false--是否满级
local curUpLvConsume = {}--升级材料
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
function this:InitComponent(gameObject)
--情报
Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/Image/Text"):GetComponent("Text").text = "基础属性"
@ -33,10 +34,10 @@ function this:InitComponent(gameObject)
this.skillClick = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/skill/skillClick")
this.skillClick2 = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/skill/skillClick2")
--属性
for i = 1, 5 do
proList[i] = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/pro/singlePro ("..i..")")
local proGrid = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/pro")
for i = 1, proGrid.transform.childCount do
proList[i] = proGrid.transform:GetChild(i-1)
end
--升级
this.upLvItemParent = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/upLvItemParent")
this.upLvItemParentText = Util.GetGameObject(gameObject,"PokemonInfoPanel_UpLv/upLvItemParent/Text"):GetComponent("Text")
@ -123,24 +124,27 @@ function this.ShowPokemonInfo()
--属性
local curAllPro = {}--加上等级
local pokemonConFig = ConfigManager.GetConfigData(ConfigName.SpiritAnimal,curPokemonData.id)
curAllPro[1] = {proName = "等级",proValue = curPokemonData.lv.."/"..pokemonConFig.MaxLevel}
curAllPro[0] = {proName = "等级",proValue = curPokemonData.lv.."/"..pokemonConFig.MaxLevel}
local curPro = PokemonManager.GetSinglePokemonAddProData(curPokemonData.dynamicId)
local index = 1
for key, value in pairs(curPro) do
local singleProData = {}
singleProData.proName = ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
singleProData.proValue = value
index = index + 1
curAllPro[index] = singleProData
curAllPro[key] = singleProData
end
local index = 0
local index = 1
for key, value in pairs(curAllPro) do
index = index + 1
if proList[index] then
Util.GetGameObject(proList[index], "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index])
if key == 0 then
Util.GetGameObject(proList[index], "Image"):GetComponent("Image").sprite = Util.LoadSprite("r_hero_jinengdian05")
else
--LogGreen(key.." "..propertyConfig[key].PropertyIcon.." "..GetResourcePath(propertyConfig[key].PropertyIcon) )
Util.GetGameObject(proList[index], "Image"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(propertyConfig[key].PropertyIcon))
end
Util.GetGameObject(proList[index], "proName"):GetComponent("Text").text=curAllPro[key].proName
Util.GetGameObject(proList[index], "proValue"):GetComponent("Text").text=curAllPro[key].proValue
end
index = index + 1
end
-- for i = 1, #proList do
-- if PropertyTypeIconDef[i] then

View File

@ -34,6 +34,19 @@ function RoleGetInfoPopup:InitComponent()
Util.GetGameObject(self.transform,"bg/RoleInfo/pro/hp/proName"):GetComponent("Text").text = propertyConfig[1].Info
Util.GetGameObject(self.transform,"bg/RoleInfo/pro/phyDef/proName"):GetComponent("Text").text = propertyConfig[3].Info
Util.GetGameObject(self.transform,"bg/RoleInfo/pro/magDef/proName"):GetComponent("Text").text = propertyConfig[4].Info
local atk_Image = Util.GetGameObject(self.transform,"bg/RoleInfo/pro/atk/Image"):GetComponent("Image")
local hp_Image = Util.GetGameObject(self.transform,"bg/RoleInfo/pro/hp/Image"):GetComponent("Image")
local phyDef_Image = Util.GetGameObject(self.transform,"bg/RoleInfo/pro/phyDef/Image"):GetComponent("Image")
local magDef_Image = Util.GetGameObject(self.transform,"bg/RoleInfo/pro/magDef/Image"):GetComponent("Image")
atk_Image.sprite = Util.LoadSprite(GetResourcePath(propertyConfig[2].PropertyIcon) )
hp_Image.sprite = Util.LoadSprite(GetResourcePath(propertyConfig[1].PropertyIcon) )
phyDef_Image.sprite = Util.LoadSprite(GetResourcePath(propertyConfig[3].PropertyIcon) )
magDef_Image.sprite = Util.LoadSprite(GetResourcePath(propertyConfig[4].PropertyIcon) )
atk_Image:SetNativeSize()
hp_Image:SetNativeSize()
phyDef_Image:SetNativeSize()
magDef_Image:SetNativeSize()
-- Util.GetGameObject(self.transform,"bg/RoleInfo/pro/speed/proName"):GetComponent("Text").text = propertyConfig[5].Info
this.atk = Util.GetGameObject(self.transform, "bg/RoleInfo/pro/atk/proValue"):GetComponent("Text")
this.hp = Util.GetGameObject(self.transform, "bg/RoleInfo/pro/hp/proValue"):GetComponent("Text")