【金钱显示】修复每日豪礼销毁再打开报错,更换MoneyNumView字体文件加载方式

dev_chengFeng
gaoxin 2021-04-10 11:07:47 +08:00
parent 26e998ee59
commit d620d4ff5e
2 changed files with 8 additions and 2 deletions

View File

@ -93,6 +93,12 @@ end
function DailyRechargePanel:OnClose()
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshPanel, self)
end
function DailyRechargePanel:OnDestroy()
if self.moneyNum then
SubUIManager.Close(self.moneyNum)
self.moneyNum = nil
end
end
function DailyRechargePanel:RefreshPanel()
local dailyActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.DailyRecharge)

View File

@ -141,7 +141,7 @@ end
-- 设置图片数字显示
function MoneyNumView:SetTextShow(txt)
self.Text_Num.text = txt
self.Text_Num.font = Util.LoadFont(self.font)
self.Text_Num.font = resMgr:LoadAsset(self.font)
self.Text_Num.fontSize = self.fontSize
self.Text_Num.transform.localScale = Vector3.one * self.localScale
self.Text_Num.transform.sizeDelta = self.rectSize
@ -156,7 +156,7 @@ function MoneyNumView:SetNumShow(numList)
if numTb[i] then
numList[i].gameObject:SetActive(true)
numList[i].text = numTb[i]
numList[i].font = Util.LoadFont(self.font)
numList[i].font = resMgr:LoadAsset(self.font)
numList[i].fontSize = self.fontSize
numList[i].transform.localScale = Vector3.one * self.localScale
numList[i].transform.sizeDelta = self.rectSize