| | |
| | | bool inited = false;
|
| | |
|
| | | long m_CurrentHp = BOSSHP_TOTAL;
|
| | | long currentHp
|
| | | {
|
| | | get
|
| | | {
|
| | | long currentHp {
|
| | | get {
|
| | | return m_CurrentHp;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (value <= 0)
|
| | | {
|
| | | m_CurrentHp = 0;
|
| | |
| | | {
|
| | | CloseClick();
|
| | | }
|
| | | }
|
| | |
|
| | | if (TargetBriefInfo.bossInfo != bossInfo)
|
| | | {
|
| | | bossInfo = TargetBriefInfo.bossInfo;
|
| | | if (bossInfo.instanceId != 0)
|
| | | {
|
| | | RefreshBossLifeBar();
|
| | | }
|
| | | RefreshBossLifeBar();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (inited)
|
| | | {
|
| | | UpdateServerRemainHP();
|
| | | UpdateServerRemainHp();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void InitBossLifeBar()
|
| | | void InitBossLifeBar()
|
| | | {
|
| | | m_BossLifeBar.gameObject.SetActive(true);
|
| | | var npcConfig = NPCConfig.Get(TargetBriefInfo.bossInfo.npcId);
|
| | | currentHp = (long)(model.mission.remainHPPer * 0.000001d * BOSSHP_TOTAL);
|
| | |
|
| | | m_BossLifeBar.SetBaseInfo(TargetBriefInfo.bossInfo.npcId, (ulong)currentHp, BOSSHP_TOTAL, npcConfig.NPCLV);
|
| | | inited = true;
|
| | | var config = NPCConfig.Get(TargetBriefInfo.bossInfo.npcId);
|
| | | if (config != null)
|
| | | {
|
| | | m_BossLifeBar.gameObject.SetActive(true);
|
| | | currentHp = (long)(model.mission.remainHPPer * 0.000001d * BOSSHP_TOTAL);
|
| | | m_BossLifeBar.SetBaseInfo(TargetBriefInfo.bossInfo.npcId, (ulong)currentHp, BOSSHP_TOTAL, config.NPCLV);
|
| | | inited = true;
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateServerRemainHP()
|
| | | private void UpdateServerRemainHp()
|
| | | {
|
| | | currentHp = (long)(model.mission.remainHPPer * 0.000001d * BOSSHP_TOTAL);
|
| | | }
|