diff --git a/Assets/ManagedResources/Effects/Animation/critAttackFloat.anim b/Assets/ManagedResources/Effects/Animation/critAttackFloat.anim index 9001f02081..a9bc37af25 100644 --- a/Assets/ManagedResources/Effects/Animation/critAttackFloat.anim +++ b/Assets/ManagedResources/Effects/Animation/critAttackFloat.anim @@ -223,7 +223,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 1.3333334 - value: 150 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -259,13 +259,6 @@ AnimationClip: typeID: 114 customType: 0 isPPtrCurve: 0 - - serializedVersion: 2 - path: 0 - attribute: 538195251 - script: {fileID: 0} - typeID: 224 - customType: 28 - isPPtrCurve: 0 - serializedVersion: 2 path: 0 attribute: 2526845255 @@ -294,6 +287,13 @@ AnimationClip: typeID: 224 customType: 28 isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 538195251 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -599,7 +599,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 1.3333334 - value: 150 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 diff --git a/Assets/ManagedResources/Effects/Animation/normalAttackFloat.anim b/Assets/ManagedResources/Effects/Animation/normalAttackFloat.anim index 57bf6ae794..5b59e04634 100644 --- a/Assets/ManagedResources/Effects/Animation/normalAttackFloat.anim +++ b/Assets/ManagedResources/Effects/Animation/normalAttackFloat.anim @@ -30,16 +30,7 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 0.16666667 - value: {x: 1.3, y: 1.3, z: 1.3} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 0.25 - value: {x: 1.3, y: 1.3, z: 1.3} + value: {x: 0.8, y: 0.8, z: 1.3} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 @@ -48,7 +39,7 @@ AnimationClip: outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 0.36666667 - value: {x: 1.3, y: 1.3, z: 1.3} + value: {x: 0.8, y: 0.8, z: 1} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 @@ -56,8 +47,8 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 0.6666667 - value: {x: 1.3, y: 1.3, z: 1.3} + time: 0.45 + value: {x: 0.8, y: 0.8, z: 1} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 @@ -82,7 +73,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -110,7 +101,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -138,7 +129,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -184,7 +175,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 0 inSlope: 0 outSlope: 0 @@ -212,7 +203,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 0 inSlope: 0 outSlope: 0 @@ -241,16 +232,16 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.36666667 - value: 50 - inSlope: 225 - outSlope: 225 + value: 0 + inSlope: 0 + outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 - value: 150 + time: 0.45 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -286,13 +277,6 @@ AnimationClip: typeID: 114 customType: 0 isPPtrCurve: 0 - - serializedVersion: 2 - path: 0 - attribute: 538195251 - script: {fileID: 0} - typeID: 224 - customType: 28 - isPPtrCurve: 0 - serializedVersion: 2 path: 0 attribute: 2526845255 @@ -321,13 +305,20 @@ AnimationClip: typeID: 224 customType: 28 isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 538195251 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 0.6666667 + m_StopTime: 0.45 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 @@ -357,16 +348,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.16666667 - value: 1.3 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.25 - value: 1.3 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -375,7 +357,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.36666667 - value: 1.3 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -383,8 +365,8 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 - value: 1.3 + time: 0.45 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -412,16 +394,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.16666667 - value: 1.3 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.25 - value: 1.3 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -430,7 +403,7 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.36666667 - value: 1.3 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -438,8 +411,8 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 - value: 1.3 + time: 0.45 + value: 0.8 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -474,18 +447,9 @@ AnimationClip: weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.25 - value: 1.3 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - serializedVersion: 3 time: 0.36666667 - value: 1.3 + value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -493,8 +457,8 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 - value: 1.3 + time: 0.45 + value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -521,7 +485,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -549,7 +513,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -577,7 +541,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 1 inSlope: 0 outSlope: 0 @@ -623,7 +587,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 0 inSlope: 0 outSlope: 0 @@ -651,7 +615,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 + time: 0.45 value: 0 inSlope: 0 outSlope: 0 @@ -680,16 +644,16 @@ AnimationClip: outWeight: 0.33333334 - serializedVersion: 3 time: 0.36666667 - value: 50 - inSlope: 225 - outSlope: 225 + value: 0 + inSlope: 0 + outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.6666667 - value: 150 + time: 0.45 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 2ba17785df..a090106d07 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -3005,8 +3005,21 @@ function GetFunctionOpenTip(_funId) end return tip end - - +--保留几位小数 +function GetPreciseDecimal(nNum, n) + if type(nNum) ~= "number" then + return nNum; + end + n = n or 0; + n = math.floor(n) + if n < 0 then + n = 0; + end + local nDecimal = 10 ^ n + local nTemp = math.floor(nNum * nDecimal); + local nRet = nTemp / nDecimal; + return nRet; +end ---获取神尊等级 function GetShenzunLv() local expNum=BagManager.GetItemCountById(1352) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index a5435eb527..d2b2ce3ecf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -726,6 +726,7 @@ function this.OnAddRole(data) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.transform.anchoredPosition = Vector2.New(0,-170) + tbRole[data].Floater:SetPosition(go.transform.position) else local enemyPos = Util.GetTransform(this.EnemyPanel, tostring(data.position)) -- go = BattlePool.GetItem(enemyPos, data.position <= 3 and BATTLE_POOL_TYPE.ENEMY_ROLE or BATTLE_POOL_TYPE.ENEMY_ROLE_2) @@ -740,6 +741,7 @@ function this.OnAddRole(data) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.transform.anchoredPosition = Vector2.New(0,-110) + tbRole[data].Floater:SetPosition(go.transform.position) end -- go.transform.position = Vector3.New(0,-160,0) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index f1f8c7c70f..6123525bcf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -583,6 +583,8 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, if isImmune and isImmune==true then return end + local t={} + local pos=self.GameObject.transform.position if skill then -- 技能配置 local combatId = BattleManager.GetCombatIdBySkin(skill.id, atkRole.roleData.skinId) @@ -591,7 +593,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, local delay = combat.DamageDelay or 0 local continue = skill.continueTime or 0 local count = type(combat.SkillNumbetTime[1][1]) == "userdata" and 1 or #combat.SkillNumbetTime - + local space = continue / count local d = math.floor(dmg / count) -- 如果平均伤害小于0 则 @@ -603,7 +605,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s, 伤害段数:%s,每段伤害:%s", self.camp, self.role.position, dmg, count, d)) end -- 伤害文字延时,有些受击特效不是立刻播放文字 - + -- 伤害文字 -- if count ~= 1 and skill.SkillNumbetTime==nil and skill.SkillNumbetTime~=0 then if count ~=1 then @@ -611,7 +613,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, for i = 1, #combat.SkillNumbetTime do self:DelayFunc(combat.SkillNumbetTime[i][2]/1000, function() local fd = dmg - d *(count - 1) - self:OnceDamaged(atkRole, fd, bCrit, finalDmg, damageType, dotType, skill) + self:OnceDamaged(atkRole, fd, bCrit, finalDmg, damageType, dotType, skill,t,pos) -- 被伤害卡牌表现 self:DOHitEffect(continue) self:DOHitMoveMent(continue,combat) @@ -631,7 +633,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, else self:DelayFunc(delay/1000, function() - self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) + self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill,t,pos) -- 被伤害卡牌表现 self:DOHitEffect() self:DOHitMoveMent(nil,combat) @@ -645,37 +647,37 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s", self.camp, self.role.position, dmg)) end -- 伤害文字 - self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) + self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill,t,pos) -- 被伤害卡牌表现 self:DOHitEffect() -- self:DOHitMoveMent(nil,combat) end end -- -function EnemyView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) +function EnemyView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill,t,pos) --王振兴注释,为了解决英雄死亡多段伤害显示不完整 2020/8/17 --if self.isDead then return end if dotType then if dotType == DotType.Poison then - self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg,TextFloatingColor.DarkGreen) + self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg,TextFloatingColor.DarkGreen,t,pos) elseif dotType == DotType.Burn then - self.Floater:ArtFloating(ArtFloatingType.FireDamage, ArtFloatingColor.Fire, dmg) + self.Floater:ArtFloating(ArtFloatingType.FireDamage, ArtFloatingColor.Fire, dmg,t,pos) elseif dotType == DotType.Blooding then - self.Floater:ArtFloating(ArtFloatingType.BleedDamage, ArtFloatingColor.Fire, dmg) + self.Floater:ArtFloating(ArtFloatingType.BleedDamage, ArtFloatingColor.Fire, dmg,t,pos) else self.Floater:TextBuffFloating(2, DotTypeTip[dotType]..dmg) end else if bCrit then -- 暴击红色并显示暴击 - self.Floater:ArtFloating(ArtFloatingType.CritDamage, ArtFloatingColor.Red, dmg) + self.Floater:ArtFloating(ArtFloatingType.CritDamage, ArtFloatingColor.Red, dmg,t,pos) else if atkRole.isTeam then -- 异妖紫色 - self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.Purple, dmg) + self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.Purple, dmg,t,pos) else if skill and skill.type == BattleSkillType.Special then -- 技能黄色 - self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.Yellow, dmg) + self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.Yellow, dmg,t,pos) else -- 普攻白色 - self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.White, dmg) + self.Floater:ArtFloating(ArtFloatingType.Damage, ArtFloatingColor.White, dmg,t,pos) end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/FloatNode.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/FloatNode.lua index 84de4c0d45..3345a8f3de 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/FloatNode.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/FloatNode.lua @@ -64,7 +64,7 @@ function FloatNode:ctor(unit, root, node) self.owner = unit self.RootPanel = root self.GameObject = node - + self.targetPos=node.transform.position self.LastBuffTextTime = Time.realtimeSinceStartup self.BuffTextCount = 0 @@ -210,21 +210,127 @@ function FloatNode:GetArtText(type, color, value) end return sp, text end -function FloatNode:ArtFloating(type, color, value,frameColor,role) +-- function FloatNode:ArtFloating(type, color, value,role) +-- local trole= role and role or nil +-- local go = BattleManager.LoadAsset(floatingEffect) +-- go.transform:SetParent(self.RootPanel.transform) +-- go.transform.localScale = Vector3.one * 0.70 +-- go.transform.position = self.GameObject.transform.position +-- local index=0 +-- local t={} +-- if trole~=nil then + + +-- local index=0 +-- if #trole.DamageTextTable== 0 then +-- trole.DamageTextTable[#trole.DamageTextTable+1]=go +-- index=#trole.DamageTextTable +-- else +-- for key, value in pairs(trole.DamageTextTable) do +-- if trole.DamageTextTable[key] == nil then +-- trole.DamageTextTable[key] =go +-- index =key +-- break +-- end +-- end +-- if index==0 then +-- trole.DamageTextTable[#trole.DamageTextTable+1]=go +-- index=#trole.DamageTextTable + +-- end +-- end +-- LogError("index=="..index) +-- go.transform.position =Vector3.New(self.GameObject.transform.position.x,self.GameObject.transform.position.y+0.15*index,self.GameObject.transform.position.z) + +-- LogError("goy"..go.transform.position.y) +-- else +-- go.transform.position = self.GameObject.transform.position +-- end +-- -- go.transform.position = self.GameObject.transform.position +-- go:SetActive(true) + +-- if Time.realtimeSinceStartup - self.LastFloatingTime < BattleLogic.GameDeltaTime then +-- self.FloatingCount = self.FloatingCount + 1 +-- else +-- self.FloatingCount = 0 +-- end +-- self.LastFloatingTime = Time.realtimeSinceStartup +-- local v2 = go:GetComponent("RectTransform").anchoredPosition +-- v2 = v2 + Vector2.New(0, self.owner.role.camp * 100 + 100) +-- go:GetComponent("RectTransform").anchoredPosition = v2 + Vector2.New(0, 50) * (self.FloatingCount+1) + +-- local sp, text = self:GetArtText(type, color, value) +-- local anim = Util.GetGameObject(go, "anim") +-- -- 伤害文字 +-- local img = Util.GetGameObject(anim, "Image"):GetComponent("Image") +-- if sp and sp ~= "" then +-- img.sprite = self.spLoader:LoadSprite(sp) +-- img.gameObject:SetActive(true) +-- else +-- img.gameObject:SetActive(false) +-- end +-- -- 伤害数值 +-- local animTxt = Util.GetGameObject(go, "anim/anim") +-- local animTxtC = animTxt:GetComponent("Text") +-- animTxtC.text = text +-- --主要用于给白色字体染色成其他颜色,color 参数只能填白色 + + +-- -- 层级和动画 +-- anim:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 100 +-- anim:GetComponent("Animator"):Play(ArtFloatingAnim[type]) + +-- BattleManager.AddDelayRecycleRes(floatingEffect, go, 3,function () +-- if trole then +-- for key, value in pairs(trole.DamageTextTable) do +-- if value == go then +-- trole.DamageTextTable[key] = nil +-- break +-- end +-- end +-- -- LogError(#trole.DamageTextTable) +-- end +-- end) +-- end +function FloatNode:ArtFloating(type, color, value,role,tarGetPos) local trole= role and role or nil + local ttarGetPos=tarGetPos and tarGetPos or self.GameObject.transform.position local go = BattleManager.LoadAsset(floatingEffect) go.transform:SetParent(self.RootPanel.transform) - go.transform.localScale = Vector3.one * 0.7 + go.transform.localScale = Vector3.one * 0.70 + self.targetPos=self.owner.SingleHitEffectRoot.gameObject.transform.position + go.transform.position = self.targetPos local index=0 local t={} if trole~=nil then - t[1]=go - table.insert(trole.DamageTextTable,t) - go.transform.position =Vector3.New(self.GameObject.transform.position.x,self.GameObject.transform.position.y+10*#trole.DamageTextTable,self.GameObject.transform.position.z) - LogError("trole.DamageTextTable"..#trole.DamageTextTable) + + local index=0 + if #trole== 0 then + trole[#trole+1]=go + index=#trole + else + for key, value in pairs(trole) do + if trole[key] == nil then + trole[key] =go + index =key + break + end + end + if index==0 then + trole[#trole+1]=go + index=#trole + + end + end + + go.transform.position =Vector3.New(GetPreciseDecimal(tonumber(self.targetPos.x),5),GetPreciseDecimal(self.targetPos.y+0.5+0.15*index,5),GetPreciseDecimal(self.targetPos.z,5)) + LogError(index) + -- LogError("Gax"..self.targetPos.x) + -- -- LogError("goy"..go.transform.position.y) + -- LogError("gox"..go.transform.position.x) else - go.transform.position = self.GameObject.transform.position + go.transform.position = self.targetPos end -- go.transform.position = self.GameObject.transform.position go:SetActive(true) @@ -237,7 +343,7 @@ function FloatNode:ArtFloating(type, color, value,frameColor,role) self.LastFloatingTime = Time.realtimeSinceStartup local v2 = go:GetComponent("RectTransform").anchoredPosition v2 = v2 + Vector2.New(0, self.owner.role.camp * 100 + 100) - go:GetComponent("RectTransform").anchoredPosition = v2 + Vector2.New(0, 50) * (self.FloatingCount+1) + --go:GetComponent("RectTransform").anchoredPosition = v2 + Vector2.New(0, 50) * (self.FloatingCount+1) local sp, text = self:GetArtText(type, color, value) local anim = Util.GetGameObject(go, "anim") @@ -259,20 +365,21 @@ function FloatNode:ArtFloating(type, color, value,frameColor,role) -- 层级和动画 anim:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 100 anim:GetComponent("Animator"):Play(ArtFloatingAnim[type]) - - BattleManager.AddDelayRecycleRes(floatingEffect, go, 2,function () + + BattleManager.AddDelayRecycleRes(floatingEffect, go, 3,function () if trole then - for key, value in pairs(trole.DamageTextTable) do - if value == t then - trole.DamageTextTable[key] = nil + for key, value in pairs(trole) do + if value == go then + trole[key] = nil break end end - LogError("trole.DamageTextTable"..#trole.DamageTextTable) + -- LogError(#trole.DamageTextTable) end end) end - - +function FloatNode:SetPosition(pos) + self.targetPos=pos +end return FloatNode \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index c38778bfc1..f9e0ef62da 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -910,6 +910,7 @@ end -- 检测是否需要震动屏幕 function SkillCaster:checkShake(combat) + -- self.owner.Floater:SetPosition(self.owner.GameObject.transform.position) if combat.ShockScreen == 1 then self.owner.RootPanel:SetShake() end