| | |
| | |
|
| | | if (_show)
|
| | | {
|
| | | var boss = GAMgr.Instance.GetBySID(_instanceId) as GActorNpcFight;
|
| | | bossInfo = new MonsterInfo()
|
| | | {
|
| | | instanceId = _instanceId,
|
| | | npcId = _npcId,
|
| | | hp = boss != null ? boss.ActorInfo.RealHp : 0,
|
| | | maxHp = boss != null ? boss.ActorInfo.RealMaxHp : 0,
|
| | | level = boss != null ? boss.ActorInfo.LV : 0
|
| | | };
|
| | |
|
| | | playerInfo = default(PlayerInfo);
|
| | |
| | | bossInfo = new MonsterInfo()
|
| | | {
|
| | | instanceId = _instanceId,
|
| | | npcId = _npcId,
|
| | | npcId = bossInfo.npcId,
|
| | | hp = _hp,
|
| | | maxHp = _maxHp
|
| | | };
|
| | |
| | |
|
| | | if (_show)
|
| | | {
|
| | | playerInfo = new PlayerInfo()
|
| | | var player = GAMgr.Instance.GetBySID(_instanceId) as GActorPlayerBase;
|
| | | if (player != null)
|
| | | {
|
| | | instanceId = _instanceId,
|
| | | };
|
| | | playerInfo = new PlayerInfo()
|
| | | {
|
| | | instanceId = _instanceId,
|
| | | job = player.ActorInfo.Job,
|
| | | name = player.ActorInfo.PlayerName,
|
| | | level = player.ActorInfo.LV,
|
| | | hp = player.ActorInfo.RealHp,
|
| | | maxHp = player.ActorInfo.RealMaxHp
|
| | | };
|
| | | }
|
| | |
|
| | | bossInfo = default(MonsterInfo);
|
| | | }
|
| | |
| | | {
|
| | | instanceId = _instanceId,
|
| | | hp = _hp,
|
| | | maxHp = _maxHp
|
| | | maxHp = _maxHp,
|
| | | job = playerInfo.job,
|
| | | level = playerInfo.level,
|
| | | name = playerInfo.name
|
| | | };
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | |
| | | public int npcId;
|
| | | public ulong hp;
|
| | | public ulong maxHp;
|
| | | public int level;
|
| | |
|
| | | public static bool operator ==(MonsterInfo lhs, MonsterInfo rhs)
|
| | | {
|
| | | return lhs.instanceId == rhs.instanceId && lhs.npcId == rhs.npcId && lhs.hp == rhs.hp && lhs.maxHp == rhs.maxHp;
|
| | | return lhs.instanceId == rhs.instanceId
|
| | | && lhs.npcId == rhs.npcId
|
| | | && lhs.hp == rhs.hp
|
| | | && lhs.maxHp == rhs.maxHp
|
| | | && lhs.level == rhs.level;
|
| | | }
|
| | |
|
| | | public static bool operator !=(MonsterInfo lhs, MonsterInfo rhs)
|
| | | {
|
| | | return lhs.instanceId != rhs.instanceId || lhs.npcId != rhs.npcId || lhs.hp != rhs.hp || lhs.maxHp != rhs.maxHp;
|
| | | return lhs.instanceId != rhs.instanceId
|
| | | || lhs.npcId != rhs.npcId
|
| | | || lhs.hp != rhs.hp
|
| | | || lhs.maxHp != rhs.maxHp
|
| | | || lhs.level != rhs.level;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public ulong hp;
|
| | | public ulong maxHp;
|
| | |
|
| | | public int job;
|
| | | public int level;
|
| | | public string name;
|
| | |
|
| | | public static bool operator ==(PlayerInfo lhs, PlayerInfo rhs)
|
| | | {
|
| | | return lhs.instanceId == rhs.instanceId && lhs.hp == rhs.hp && lhs.maxHp == rhs.maxHp;
|
| | | return lhs.instanceId == rhs.instanceId
|
| | | && lhs.hp == rhs.hp
|
| | | && lhs.maxHp == rhs.maxHp
|
| | | && lhs.job == rhs.job
|
| | | && lhs.level == rhs.level
|
| | | && lhs.name == rhs.name;
|
| | | }
|
| | |
|
| | | public static bool operator !=(PlayerInfo lhs, PlayerInfo rhs)
|
| | | {
|
| | | return lhs.instanceId != rhs.instanceId || lhs.hp != rhs.hp || lhs.maxHp != rhs.maxHp;
|
| | | return lhs.instanceId != rhs.instanceId
|
| | | || lhs.hp != rhs.hp
|
| | | || lhs.maxHp != rhs.maxHp
|
| | | || lhs.job != rhs.job
|
| | | || lhs.level != rhs.level
|
| | | || lhs.name != rhs.name;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (playerInfo.instanceId != 0)
|
| | | {
|
| | | ShowPlayerLifeBar(playerInfo.instanceId, true);
|
| | | ShowPlayerLifeBar(playerInfo, true);
|
| | | }
|
| | | else
|
| | | {
|
| | | ShowPlayerLifeBar(0, false);
|
| | | ShowPlayerLifeBar(playerInfo, false);
|
| | |
|
| | | if (bossInfo.instanceId != 0)
|
| | | {
|
| | | ShowBossLifeBar(bossInfo.instanceId, bossInfo.npcId, true);
|
| | | ShowBossLifeBar(bossInfo, true);
|
| | | }
|
| | | else
|
| | | {
|
| | | ShowBossLifeBar(0, 0, false);
|
| | | ShowBossLifeBar(bossInfo, false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | if (TargetBriefInfo.bossInfo != bossInfo)
|
| | | {
|
| | | bossInfo = TargetBriefInfo.bossInfo;
|
| | | if (bossInfo.instanceId == 0)
|
| | | if (TargetBriefInfo.bossInfo.instanceId == 0)
|
| | | {
|
| | | ShowBossLifeBar(0, 0, false);
|
| | | ShowBossLifeBar(TargetBriefInfo.bossInfo, false);
|
| | | }
|
| | | else
|
| | | {
|
| | | RefreshBossLifeBar(bossInfo.instanceId, bossInfo.npcId, bossInfo.hp, bossInfo.maxHp);
|
| | | if (bossInfo.npcId != TargetBriefInfo.bossInfo.npcId)
|
| | | {
|
| | | ShowBossLifeBar(TargetBriefInfo.bossInfo, true);
|
| | | }
|
| | | else
|
| | | {
|
| | | RefreshBossLifeBar(TargetBriefInfo.bossInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | bossInfo = TargetBriefInfo.bossInfo;
|
| | | }
|
| | |
|
| | | if (TargetBriefInfo.playerInfo != playerInfo)
|
| | | {
|
| | | playerInfo = TargetBriefInfo.playerInfo;
|
| | | if (playerInfo.instanceId == 0)
|
| | | {
|
| | | ShowPlayerLifeBar(0, false);
|
| | | ShowPlayerLifeBar(TargetBriefInfo.playerInfo, false);
|
| | | }
|
| | | else
|
| | | {
|
| | | RefreshPlayerLifeBar(playerInfo.instanceId, playerInfo.hp, playerInfo.maxHp);
|
| | | if (playerInfo.instanceId != TargetBriefInfo.playerInfo.instanceId)
|
| | | {
|
| | | ShowPlayerLifeBar(TargetBriefInfo.playerInfo, true);
|
| | | }
|
| | | else
|
| | | {
|
| | | RefreshPlayerLifeBar(TargetBriefInfo.playerInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | playerInfo = TargetBriefInfo.playerInfo;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | void ShowBossLifeBar(uint _instanceId, int _npcId, bool _show)
|
| | | void ShowBossLifeBar(TargetBriefInfo.MonsterInfo bossInfo, bool show)
|
| | | {
|
| | | if (_show)
|
| | | if (show)
|
| | | {
|
| | | m_ContainerPlayer.gameObject.SetActive(false);
|
| | | m_ContainerBoss.gameObject.SetActive(true);
|
| | | m_FairyGrabBossBuffTip.Init();
|
| | |
|
| | | var boss = GAMgr.Instance.GetBySID(_instanceId) as GActorNpcFight;
|
| | | if (boss != null)
|
| | | {
|
| | | m_BossLifeBar.SetBaseInfo(_npcId, boss.ActorInfo.RealHp, boss.ActorInfo.RealMaxHp, boss.ActorInfo.LV);
|
| | | }
|
| | |
|
| | | m_ElderGodAnger.Display(_npcId);
|
| | | m_FairyGrabBossBuffTip.Display(_npcId);
|
| | | m_BossLifeBar.SetBaseInfo(bossInfo.npcId, bossInfo.hp, bossInfo.maxHp, bossInfo.level);
|
| | | m_ElderGodAnger.Display(bossInfo.npcId);
|
| | | m_FairyGrabBossBuffTip.Display(bossInfo.npcId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void RefreshBossLifeBar(uint _instanceId, int _npcId, ulong _hp, ulong _maxHp)
|
| | | void RefreshBossLifeBar(TargetBriefInfo.MonsterInfo bossInfo)
|
| | | {
|
| | | m_ContainerBoss.gameObject.SetActive(true);
|
| | | m_BossLifeBar.Show(_hp, _maxHp);
|
| | | m_BossLifeBar.Show(bossInfo.hp, bossInfo.maxHp);
|
| | | }
|
| | |
|
| | | void ShowPlayerLifeBar(uint _instanceId, bool _show)
|
| | | void ShowPlayerLifeBar(TargetBriefInfo.PlayerInfo playerInfo, bool show)
|
| | | {
|
| | | if (_show)
|
| | | if (show)
|
| | | {
|
| | | var player = GAMgr.Instance.GetBySID(_instanceId) as GActorPlayerBase;
|
| | | if (player != null)
|
| | | {
|
| | | m_ContainerPlayer.gameObject.SetActive(true);
|
| | | m_ContainerBoss.gameObject.SetActive(false);
|
| | | m_FairyGrabBossBuffTip.UnInit();
|
| | | m_ContainerPlayer.gameObject.SetActive(true);
|
| | | m_ContainerBoss.gameObject.SetActive(false);
|
| | | m_FairyGrabBossBuffTip.UnInit();
|
| | |
|
| | | var job = player.ActorInfo.Job;
|
| | | var reincarnationLv = player.ActorInfo.ReincarnationLv;
|
| | | var playerName = player.ActorInfo.PlayerName;
|
| | | var playerLevel = player.ActorInfo.LV;
|
| | | var playerHp = player.ActorInfo.RealHp;
|
| | | var playerMaxHp = player.ActorInfo.RealMaxHp;
|
| | | var instanceId = playerInfo.instanceId;
|
| | | var job = playerInfo.job;
|
| | | var playerName = playerInfo.name;
|
| | | var playerLevel = playerInfo.level;
|
| | | var playerHp = playerInfo.hp;
|
| | | var playerMaxHp = playerInfo.maxHp;
|
| | |
|
| | | m_PlayerLifeBar.SetBaseInfo((int)_instanceId, job, reincarnationLv, playerName, playerLevel, playerHp, playerMaxHp);
|
| | | }
|
| | | m_PlayerLifeBar.SetBaseInfo((int)instanceId, job, 0, playerName, playerLevel, playerHp, playerMaxHp);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | void RefreshPlayerLifeBar(uint _instanceId, ulong _hp, ulong _maxHp)
|
| | | void RefreshPlayerLifeBar(TargetBriefInfo.PlayerInfo playerInfo)
|
| | | {
|
| | | m_ContainerPlayer.gameObject.SetActive(true);
|
| | | m_PlayerLifeBar.Show(_hp, _maxHp);
|
| | | m_PlayerLifeBar.Show(playerInfo.hp, playerInfo.maxHp);
|
| | | }
|
| | |
|
| | | }
|