From 0fd125dcfc36ec43662d548b3de00d3a157b4504 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 28 Jul 2023 10:49:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/bf/unity/uiprefab_object.lua | 3 +++ lua/app/ui/common/cell/hero_cell.lua | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lua/app/bf/unity/uiprefab_object.lua b/lua/app/bf/unity/uiprefab_object.lua index 996e5530..ffa3e57d 100644 --- a/lua/app/bf/unity/uiprefab_object.lua +++ b/lua/app/bf/unity/uiprefab_object.lua @@ -763,6 +763,9 @@ function UIPrefabObject:addRedPoint(offsetX, offsetY, scale, iconName, count, na if not self.redPoint then if not self.loadRpOver then self.loadRpOver = true + if self:isDestroyed() or CS.BF.Utils.IsNull(self:getGameObject()) then + return + end UIPrefabManager:loadUIWidgetAsync("assets/prefabs/ui/common/red_point_cell.prefab", self, function(prefabObject) self.redPoint = prefabObject prefabObject:initPrefabHelper() diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 732496b6..3812df2e 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -95,6 +95,10 @@ function HeroCell:refreshRedPoint() return end + if not self.selfNode or self.selfNode:isDestroyed() or CS.BF.Utils.IsNull(self.selfNode:getGameObject()) then + return + end + if DataManager.FormationData:heroInFormation(GConst.BattleConst.FORMATION_TYPE.STAGE, self.heroEntity:getCfgId()) and DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then self.selfNode:addRedPoint(55, -35, 0.64) else