Update - 1.16.0.138
EN: 1.16.0.138 CN: 1.16.0.137 JP: 1.16.0.141 KR: 1.16.0.143
This commit is contained in:
@@ -8,6 +8,7 @@ HudMainCtrl._mapNodeConfig = {
|
||||
}
|
||||
HudMainCtrl._mapEventConfig = {
|
||||
PlayerShow = "OnEvent_PlayerShowChanged",
|
||||
PlayerBloodShow = "OnEvent_PlayerBloodShow",
|
||||
ShowBossHUD = "OnEvent_ShowBossHUD",
|
||||
MonsterHUDChange = "OnEvent_MonsterHUDChange",
|
||||
AllHudShow = "OnEvent_AllHudShowChanged",
|
||||
@@ -34,6 +35,7 @@ function HudMainCtrl:OnEnable()
|
||||
self.resistanceTipInterval = ConfigTable.GetConfigNumber("HudResistanceTipInterval")
|
||||
self.hudId = 0
|
||||
self.playerHuds = {}
|
||||
self.tbPlayerBloodState = {}
|
||||
self.monsterHuds = {}
|
||||
self.monsterAdvHuds = {}
|
||||
self.numberHuds = {}
|
||||
@@ -111,6 +113,7 @@ function HudMainCtrl:Clear()
|
||||
end
|
||||
self.hudId = 0
|
||||
self.playerHuds = {}
|
||||
self.tbPlayerBloodState = {}
|
||||
self.monsterHuds = {}
|
||||
self.monsterAdvHuds = {}
|
||||
self.numberHuds = {}
|
||||
@@ -204,12 +207,26 @@ function HudMainCtrl:OnEvent_PlayerShowChanged(id, showed)
|
||||
if playerHud ~= nil then
|
||||
playerHud:SetPlayerId(id)
|
||||
AdventureModuleHelper.SetHudFollowTarget(id, playerHud.gameObject, Vector3.zero, false)
|
||||
if self.tbPlayerBloodState[id] == false then
|
||||
playerHud:SetBloodVisible(false)
|
||||
end
|
||||
end
|
||||
elseif playerHud ~= nil then
|
||||
self:DespawnPrefabInstance(playerHud, "HUD")
|
||||
self.playerHuds[id] = nil
|
||||
end
|
||||
end
|
||||
function HudMainCtrl:OnEvent_PlayerBloodShow(id, showed)
|
||||
printLog("HudMainCtrl:OnEvent_PlayerBloodShow id=" .. tostring(id) .. " showed=" .. tostring(showed))
|
||||
if id == 0 then
|
||||
return
|
||||
end
|
||||
self.tbPlayerBloodState[id] = showed
|
||||
local playerHud = self.playerHuds[id]
|
||||
if playerHud ~= nil then
|
||||
playerHud:SetBloodVisible(showed)
|
||||
end
|
||||
end
|
||||
function HudMainCtrl:OnEvent_AllHudShowChanged(showed)
|
||||
if self.TEST_VISIBLE_HUD_DAMAGE == true then
|
||||
self._mapNode.Root.transform.localScale = showed and Vector3.one or Vector3.zero
|
||||
|
||||
@@ -213,6 +213,7 @@ function PlayerHudCtrl:Awake()
|
||||
end
|
||||
function PlayerHudCtrl:OnEnable()
|
||||
self.playerId = 0
|
||||
self.bBloodVisible = true
|
||||
self._mapNode.AmmoBar:SetActive(false)
|
||||
self:ResetHit()
|
||||
end
|
||||
@@ -239,6 +240,7 @@ function PlayerHudCtrl:SetPlayerId(playerId)
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.canvasGroup, 1)
|
||||
end
|
||||
self.playerId = playerId
|
||||
self._mapNode.rtBuff:BindEntity(self.playerId)
|
||||
self:ResetHit()
|
||||
self:KillTween()
|
||||
local ammoMax = AdventureModuleHelper.GetEntityAmmoMax(self.playerId)
|
||||
@@ -253,7 +255,6 @@ function PlayerHudCtrl:SetPlayerId(playerId)
|
||||
self:OnEvent_JsAniObjActive(activeJs)
|
||||
local shieldValue, shieldValueMax = AdventureModuleHelper.GetEntityShieldValue(self.playerId)
|
||||
self:SetShield(shieldValue, shieldValueMax, true)
|
||||
self._mapNode.rtBuff:BindEntity(self.playerId)
|
||||
EventManager.AddEntityEvent("HpChanged", self.playerId, self, self.OnEvent_HpChanged)
|
||||
EventManager.AddEntityEvent("AmmoChanged", self.playerId, self, self.OnEvent_AmmoChanged)
|
||||
EventManager.AddEntityEvent("BuffReduceTime", self.playerId, self, self.OnEvent_JsAniObjActive)
|
||||
@@ -343,7 +344,15 @@ end
|
||||
function PlayerHudCtrl:OnEvent_Deaded()
|
||||
EventManager.Hit("PlayerShow", self.playerId, false)
|
||||
end
|
||||
function PlayerHudCtrl:SetBloodVisible(bShow)
|
||||
self.bBloodVisible = bShow
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.canvasGroup, bShow and 1 or 0)
|
||||
end
|
||||
function PlayerHudCtrl:OnEvent_ShowPlayerHudRootCanvas()
|
||||
if self.bBloodVisible == false then
|
||||
NovaAPI.SetEntryLevelFade(false)
|
||||
return
|
||||
end
|
||||
local sequence = DOTween.Sequence()
|
||||
sequence:Append(self._mapNode.canvasGroup:DOFade(1, 0.7):SetUpdate(true))
|
||||
sequence:AppendCallback(function()
|
||||
|
||||
Reference in New Issue
Block a user