伤害数字对象池
This commit is contained in:
parent
d52e92b6b0
commit
94b3c3ddc5
@ -90,7 +90,11 @@ function BattleHelper:setEffectTextCache(cache1, cache2, cache3, cache4)
|
||||
end
|
||||
|
||||
function BattleHelper:getEffectText(parent, colorType)
|
||||
local pool = self.battleEffectTextPool[colorType] or {}
|
||||
local pool = self.battleEffectTextPool[colorType]
|
||||
if pool == nil then
|
||||
pool = {}
|
||||
self.battleEffectTextPool[colorType] = {}
|
||||
end
|
||||
if #pool <= 0 then
|
||||
local prefab = CS.UnityEngine.Object.Instantiate(self.effectTextCacheList[colorType]:getGameObject())
|
||||
local prefabObject = UIPrefabObject:create()
|
||||
@ -117,7 +121,11 @@ function BattleHelper:recycleEffectText(comp)
|
||||
end
|
||||
comp:setEnabled(false)
|
||||
local colorType = comp:getColorType()
|
||||
local pool = self.battleEffectTextPool[colorType] or {}
|
||||
local pool = self.battleEffectTextPool[colorType]
|
||||
if pool == nil then
|
||||
pool = {}
|
||||
self.battleEffectTextPool[colorType] = {}
|
||||
end
|
||||
table.insert(pool, comp)
|
||||
if self.battleEffectTextMap then
|
||||
self.battleEffectTextMap[comp.baseObject:getInstanceID()] = nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user