diff --git a/Assets/ManagedResources/PublicArtRes/Materials/UI_AlphaMask 2.mat b/Assets/ManagedResources/PublicArtRes/Materials/UI_AlphaMask 2.mat index 8b323eaefc..85758d1c64 100644 --- a/Assets/ManagedResources/PublicArtRes/Materials/UI_AlphaMask 2.mat +++ b/Assets/ManagedResources/PublicArtRes/Materials/UI_AlphaMask 2.mat @@ -74,7 +74,7 @@ Material: - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 - - _IsMask: 0 + - _IsMask: 1 - _Metallic: 0 - _Mode: 0 - _OcclusionStrength: 1 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/RoleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/RoleView.lua index 2625d8d200..dc8df1a69f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/RoleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/RoleView.lua @@ -297,9 +297,53 @@ function RoleView:ClearDelayFunc(t) end self._DelayFuncList = {} end - end +-- +function RoleView:LoopFunc(time, count, func) + if count <= 0 then + LogError("无法用于无限循环的方法") + return + end + if not self._LoopFuncList then + self._LoopFuncList = {} + end + local timer = nil + local ctr = 0 + timer = Timer.New(function () + if func then func() end + ctr = ctr + 1 + if ctr >= count then + self:ClearDelayFunc(timer) + end + end, time, count) + timer:Start() + table.insert(self._LoopFuncList, timer) +end +function RoleView:ClearLoopFunc(t) + if not self._LoopFuncList then return end + if t then + local rIndex + for index, timer in ipairs(self._LoopFuncList) do + if timer == t then + rIndex = index + break + end + end + if rIndex then + self._LoopFuncList[rIndex]:Stop() + table.remove(self._LoopFuncList, rIndex) + end + else + for _, timer in ipairs(self._LoopFuncList) do + timer:Stop() + end + self._LoopFuncList = {} + end +end + + + local TextFloatingColor = { Blue = 1, Red = 2, @@ -1086,9 +1130,9 @@ function RoleView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, end if count ~= 1 then -- 后续伤害延迟打出 - Timer.New(function() + self:LoopFunc(space, count - 1, function() self:OnceDamaged(atkRole, d, bCrit, finalDmg, damageType, dotType, skill) - end, space, count - 1):Start() + end) -- 立刻打出第一次伤害 local fd = dmg - d *(count - 1) self:OnceDamaged(atkRole, fd, bCrit, finalDmg, damageType, dotType, skill) @@ -1101,7 +1145,7 @@ function RoleView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, end -- function RoleView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) - if atkRole:IsDead() then return end + if self.isDead then return end if dotType then if dotType == DotType.Poison then self:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg) @@ -1614,6 +1658,7 @@ function RoleView:Dispose() -- end -- 清空所有延迟方法 self:ClearDelayFunc() + self:ClearLoopFunc() self.GameObject.transform.parent.localScale = Vector3.one --立即回收延迟列表上的资源