【最佳】加入主角伤害展示

gaoxin 2021-11-10 02:52:51 +08:00
parent 3f2ce26aff
commit 24ea182587
2 changed files with 41 additions and 16 deletions

View File

@ -150,16 +150,22 @@ function this.GetBattleBestData(Id)
-- 怪物只显示最后一层的怪物信息
if data.info and data.info.camp == 0 then
-- 计算最大值(不计算异妖的)
if data.info.type == BattleUnitType.Role and data.info.position<7 then
if data.info.type == BattleUnitType.Role then -- 神将
if data.damage > _MaxDamageValue then
_MaxDamageData = {
roleId = data.info.roleData.roleId,
skinId = data.info.roleData.skinId,
damage = data.damage,
}
if data.info.position == 100 then
_MaxDamageData = {
roleId = -1,
skinId = nil,
damage = data.damage,
}
else
_MaxDamageData = {
roleId = data.info.roleData.roleId,
skinId = data.info.roleData.skinId,
damage = data.damage,
}
end
_MaxDamageValue = data.damage
elseif data.damage == _MaxDamageValue then
-- 伤害相同如何判断最佳
end
end
_AllDamageValue = _AllDamageValue + data.damage

View File

@ -1,4 +1,5 @@
require("Base/BasePanel")
local SpiritAnimal = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local BattleBestPopup = Inherit(BasePanel)
local this = BattleBestPopup
local func2 = nil--此回调目前只有大闹天宫试炼节点用 当有没有事件时 关闭按钮不好使
@ -31,18 +32,36 @@ function BattleBestPopup:BindEvent()
end)
end
function this:OnOpen(heroTId,skinId, damageValue, allDamage, func,_func2)
function this:OnOpen(heroTId, skinId, damageValue, allDamage, func,_func2)
func2 = _func2
-- 创建立绘
local heroTData=nil
--如果有皮肤读取皮肤表里面的数据没有读取hero表
if skinId and skinId>0 then
heroTData=ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",skinId)
local heroTData = {}
if heroTId > 0 then
--如果有皮肤读取皮肤表里面的数据没有读取hero表
local data = nil
if skinId and skinId>0 then
data = ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",skinId)
else
data= ConfigManager.GetConfigData(ConfigName.HeroConfig,heroTId)
end
heroTData.Live = GetResourcePath(data.Live)
heroTData.Scale = data.Scale
heroTData.Position = data.Position
heroTData.Name = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.HeroConfig,heroTId).ReadingName)
else
heroTData= ConfigManager.GetConfigData(ConfigName.HeroConfig,heroTId)
if NameManager.roleSex == ROLE_SEX.BOY then
heroTData.Live = "live2d_npc_boy"
heroTData.Scale = 0.6
heroTData.Position = {127, -164}
else
heroTData.Live = "live2d_npc_girl"
heroTData.Scale = 0.6
heroTData.Position = {127, -340}
end
heroTData.Name = NameManager.roleName
end
this.liveName = GetResourcePath(heroTData.Live)
this.liveName = heroTData.Live
this.liveNode = poolManager:LoadLive(this.liveName, this.firstRole.transform, Vector3.one * heroTData.Scale, Vector3.New(heroTData.Position[1], heroTData.Position[2]))
this.liveNode.transform.sizeDelta = Vector2.New(10, 10)
local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
@ -58,7 +77,7 @@ function this:OnOpen(heroTId,skinId, damageValue, allDamage, func,_func2)
-- 名称
this.firstName.text = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.HeroConfig,heroTId).ReadingName)
this.firstName.text = heroTData.Name
-- 伤害数值
this.firstDamage.text = damageValue
-- 伤害占比