void SetRoleExp(Client.IEntity entity) { if (entity == null || m_slider_expSprite_bg == null) { return; } //经验值exp显示 table.UpgradeDataBase data = GameTableManager.Instance.GetTableItem <table.UpgradeDataBase>((uint)entity.GetProp((int)CreatureProp.Level)); ulong maxExp = data.qwExp; m_label_Labelexp.text = string.Format("经验{0}%", Mathf.Floor((entity.GetProp((int)PlayerProp.Exp) + 0.0f) / (int)maxExp * 100)); m_slider_expSprite_bg.value = (entity.GetProp((int)PlayerProp.Exp) + 0.0f) / (int)maxExp; }
/// <summary> /// 第五 /// </summary> /// <param name="id"></param> void ShowByPlayer(IPlayer player) { m_label_Name.text = player.GetName(); m_label_Level.text = player.GetProp((int)CreatureProp.Level).ToString(); //PK值显示 m_label_PKzhi.text = player.GetProp((int)PlayerProp.PKValue).ToString();; m_label_hp_percent.text = player.GetProp((int)CreatureProp.Hp).ToString() + "/" + player.GetProp((int)CreatureProp.MaxHp).ToString(); m_slider_Hpslider.value = (player.GetProp((int)CreatureProp.Hp) + 0.0f) / (player.GetProp((int)CreatureProp.MaxHp)); //魔法值mp显示 m_label_mp_percent.text = player.GetProp((int)CreatureProp.Mp).ToString() + "/" + player.GetProp((int)CreatureProp.MaxMp).ToString(); m_slider_Mpslider.value = (player.GetProp((int)CreatureProp.Mp) + 0.0f) / (player.GetProp((int)CreatureProp.MaxMp)); //经验值exp显示 table.UpgradeDataBase data = GameTableManager.Instance.GetTableItem <table.UpgradeDataBase>((uint)player.GetProp((int)CreatureProp.Level)); ulong maxExp = 0; if (data != null) { maxExp = data.qwExp; } m_label_exp_percent.text = player.GetProp((int)PlayerProp.Exp).ToString() + "/" + maxExp.ToString(); m_slider_Expslider.value = (player.GetProp((int)PlayerProp.Exp) + 0.0f) / (int)maxExp; if (DataManager.Manager <ClanManger>().IsJoinClan) { m_label_clanName.text = DataManager.Manager <ClanManger>().ClanInfo.Name; } else { m_label_clanName.text = "未加入"; } int job = player.GetProp((int)PlayerProp.Job); SelectRoleDataBase roledata = table.SelectRoleDataBase.Where((GameCmd.enumProfession)job, (GameCmd.enmCharSex) 1); if (roledata != null && null != m__headicon) { UIManager.GetTextureAsyn(roledata.strprofessionIcon, ref m_playerCASD, () => { if (m__headicon != null) { m__headicon.mainTexture = null; } }, m__headicon, false); } //神魔经验 // uint shenmoLevel = (uint)player.GetProp((int)PlayerProp.GodLevel) + 1; // GodDemonDataBase god = GameTableManager.Instance.GetTableItem<GodDemonDataBase>(shenmoLevel); // string godExp = ""; // float godSliderValue = 0.0f; // if (god == null) // { // godExp = "--/--"; // godSliderValue = 0.0f; // } // else // { // godExp = string.Format("{0}/{1}", DataManager.Manager<HeartSkillManager>().GhostExp, god.up_exp); // godSliderValue = (DataManager.Manager<HeartSkillManager>().GhostExp + 0.0f) / god.up_exp; // } // m_label_godexp_percent.text = godExp; // m_slider_GodExpslider.value = godSliderValue; #region 基础属性label赋值 //基础属性面板获取数据 m_label_liliang.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Strength).ToString()); m_label_minjie.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Agility).ToString()); m_label_zhili.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Intelligence).ToString()); m_label_tili.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Corporeity).ToString()); m_label_jingli.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Spirit).ToString()); m_label_wuligongji.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.PhysicsAttack).ToString() + "-" + player.GetProp((int)FightCreatureProp.MaxPhysicsAttack).ToString()); m_label_fashugongji.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.MagicAttack).ToString() + "-" + player.GetProp((int)FightCreatureProp.MaxMagicAttack).ToString()); m_label_wulifangyu.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.PhysicsDefend).ToString() + "-" + player.GetProp((int)FightCreatureProp.MaxPhysicsDefend).ToString()); m_label_fashufangyu.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.MagicDefend).ToString() + "-" + player.GetProp((int)FightCreatureProp.MaxMagicDefend).ToString()); m_label_zhiliao.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.Cure).ToString()); m_label_mingzhong.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.Hit) / 100.0)).ToString("g0") + "%"); m_label_shanbi.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.Dodge) / 100.0)).ToString("g0") + "%"); m_label_wulibaoji.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.PhysicsCrit) / 100.0)).ToString("g0") + "%"); m_label_fashubaoji.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.MagicCrit) / 100.0)).ToString("g0") + "%"); m_label_baojishanghai.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.CritiRatio) / 100.0)).ToString("g0") + "%"); m_label_huogong.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.FireAttack).ToString()); m_label_binggong.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.IceAttack).ToString()); m_label_diangong.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.EleAttack).ToString()); m_label_angong.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.WitchAttack).ToString()); m_label_huofang.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.FireDefend).ToString()); m_label_bingfang.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.IceDefend).ToString()); m_label_dianfang.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.EleDefend).ToString()); m_label_anfang.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.WitchDefend).ToString()); m_label_shanghaijiashen.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.HarmDeepen) / 100.0)).ToString("g0") + "%"); m_label_wushangxishou.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.PhysicsAbsorb).ToString()); m_label_fashangxishou.text = string.Format("[00ff00]{0}", player.GetProp((int)FightCreatureProp.MagicAbsorb).ToString()); m_label_shanghaixishou.text = string.Format("[00ff00]{0:N2}", ((player.GetProp((int)FightCreatureProp.HarmAbsorb) / 100.0)).ToString("g0") + "%"); #endregion #region 详情赋值 // m_label_dengji.text = player.GetProp((int)CreatureProp.Level).ToString(); // m_label_shenmodengji.text = player.GetProp((int)PlayerProp.GodLevel).ToString(); // m_label_hongmingzhi.text = player.GetProp((int)PlayerProp.PKValue).ToString(); // if (DataManager.Manager<ClanManger>().IsJoinClan) // { // m_label_shizu.text = DataManager.Manager<ClanManger>().ClanInfo.Name; // } // else // { // m_label_shizu.text = "未加入"; // } m_label_bianhao.text = player.GetID().ToString(); m_label_PKNum.text = player.GetProp((int)PlayerProp.PKValue).ToString(); m_label_shengmingzhi.text = player.GetProp((int)CreatureProp.MaxHp).ToString(); m_label_fashuzhi.text = player.GetProp((int)CreatureProp.MaxMp).ToString(); m_label_liliang2.text = m_label_liliang.text; m_label_minjie2.text = m_label_minjie.text; m_label_zhili2.text = m_label_zhili.text; m_label_tili2.text = m_label_tili.text; m_label_jingli2.text = m_label_jingli.text; m_label_wuligongji2.text = m_label_wuligongji.text; m_label_wulifangyu2.text = m_label_wulifangyu.text; m_label_zhiliao2.text = m_label_zhiliao.text; m_label_fashugongji2.text = m_label_fashugongji.text; m_label_fashufangyu2.text = m_label_fashufangyu.text; #endregion RefreshWorldLevel(m_uintWorldLevel); }