| | |
| | |
|
| | | public class TargetBriefInfo
|
| | | {
|
| | |
|
| | | public static int selectedNpcId { get; private set; }
|
| | |
|
| | | public static PlayerInfo playerInfo { get; private set; }
|
| | | public static MonsterInfo bossInfo { get; private set; }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (_show)
|
| | | bossInfo = new MonsterInfo()
|
| | | {
|
| | | selectedNpcId = _npcId;
|
| | | }
|
| | | else
|
| | | {
|
| | | selectedNpcId = 0;
|
| | | }
|
| | | instanceId = _show ? _instanceId : 0,
|
| | | npcId = _show ? _npcId : 0,
|
| | | };
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
|
| | |
| | | {
|
| | | if (_show)
|
| | | {
|
| | |
|
| | | DemonJarBossLifeBarWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<DemonJarBossLifeBarWin>())
|
| | | {
|
| | | win = WindowCenter.Instance.Open<DemonJarBossLifeBarWin>(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | win = WindowCenter.Instance.Get<DemonJarBossLifeBarWin>();
|
| | | }
|
| | |
|
| | | win.InitBossLifeBar();
|
| | | WindowCenter.Instance.Open<DemonJarBossLifeBarWin>();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | TargetBriefInfoWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | | {
|
| | | win = WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | win = WindowCenter.Instance.Get<TargetBriefInfoWin>();
|
| | | }
|
| | |
|
| | | win.ShowBossLifeBar(_instanceId, _npcId, _show);
|
| | | WindowCenter.Instance.Open<TargetBriefInfoWin>();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | selectedNpcId = _npcId;
|
| | | bossInfo = new MonsterInfo()
|
| | | {
|
| | | instanceId = _instanceId,
|
| | | npcId = _npcId,
|
| | | hp = _hp,
|
| | | maxHp = _maxHp
|
| | | };
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
|
| | | var dataMapId = MapUtility.GetDataMapId(mapId);
|
| | | if (dataMapId == DemonJarModel.DEMONJAR_MAPID
|
| | | || dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP
|
| | | || dataMapId == JadeDynastyTowerModel.DATA_MAPID)
|
| | | {
|
| | | DemonJarBossLifeBarWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<DemonJarBossLifeBarWin>())
|
| | | if (!WindowCenter.Instance.IsOpen("DemonJarBossLifeBarWin"))
|
| | | {
|
| | | win = WindowCenter.Instance.Open<DemonJarBossLifeBarWin>(true);
|
| | | WindowCenter.Instance.Open<DemonJarBossLifeBarWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | win = WindowCenter.Instance.Get<DemonJarBossLifeBarWin>();
|
| | | }
|
| | |
|
| | | win.RefreshBossLifeBar();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (PlayerDatas.Instance.hero != null && PlayerDatas.Instance.hero.SelectTarget != null
|
| | | && PlayerDatas.Instance.hero.SelectTarget.ServerInstID == TargetBriefInfoWin.currentBossInstanceId)
|
| | | {
|
| | | TargetBriefInfoWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | | if (!WindowCenter.Instance.IsOpen("TargetBriefInfoWin"))
|
| | | {
|
| | | win = WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | win = WindowCenter.Instance.Get<TargetBriefInfoWin>();
|
| | | }
|
| | |
|
| | | win.RefreshBossLifeBar(_instanceId, _npcId, _hp, _maxHp);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | playerInfo = new PlayerInfo()
|
| | | {
|
| | | instanceId = _show ? _instanceId : 0,
|
| | | };
|
| | |
|
| | | if (WindowCenter.Instance.IsOpen("DemonJarBossLifeBarWin"))
|
| | | {
|
| | | WindowCenter.Instance.Close<DemonJarBossLifeBarWin>();
|
| | | }
|
| | |
|
| | | TargetBriefInfoWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | | {
|
| | | win = WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | win = WindowCenter.Instance.Get<TargetBriefInfoWin>();
|
| | | }
|
| | |
|
| | | win.ShowPlayerLifeBar(_instanceId, _show);
|
| | | WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | }
|
| | |
|
| | | static void OnRefreshPlayerLifeBar(uint _instanceId, ulong _hp, ulong _maxHp)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | var win = WindowCenter.Instance.Get<TargetBriefInfoWin>();
|
| | | if (win != null)
|
| | | playerInfo = new PlayerInfo()
|
| | | {
|
| | | win.RefreshPlayerLifeBar(_instanceId, _hp, _maxHp);
|
| | | instanceId = _instanceId,
|
| | | hp = _hp,
|
| | | maxHp = _maxHp
|
| | | };
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<TargetBriefInfoWin>(true);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct MonsterInfo
|
| | | {
|
| | | public int instanceId;
|
| | | public uint instanceId;
|
| | | public int npcId;
|
| | | public long hp;
|
| | | public long maxHp;
|
| | | public ulong hp;
|
| | | public ulong maxHp;
|
| | | }
|
| | |
|
| | | public struct PlayerInfo
|
| | | {
|
| | | public int instanceId;
|
| | | public long hp;
|
| | | public long maxHp;
|
| | | public uint instanceId;
|
| | | public ulong hp;
|
| | | public ulong maxHp;
|
| | | }
|
| | |
|
| | | }
|