//显示血条 public void ShowBloodBar() { if (BloodBar != null) { BloodBar.SetVisible(true); this.OnUpdateHp(); //Player需要更新Mp if (entityType == EntityType.Player) { BloodBarPlayer BloodBarPlayer = BloodBar as BloodBarPlayer; BloodBarPlayer.UpdateMp(); } } }
public int OnNotifyMPChange(MpChange pMsg) { UInt64 sGUID = pMsg.guid; Player entity; if (PlayersManager.Instance.PlayerDic.TryGetValue(sGUID, out entity)) { entity.SetMp((float)pMsg.mp);//设置Mp值 BloodBarPlayer BloodBarPlayer = (BloodBarPlayer)entity.BloodBar; //更新蓝条 entity.UpdateMp(entity); } return((Int32)EErrorCode.eNormal); }
public int OnNotifyMPInfo(NotifyMPInfo pMsg) { foreach (GSToGC.NotifyMPInfo.MPInfo info in pMsg.mpinfo) { UInt64 sGUID = info.guid; Player entity; if (PlayersManager.Instance.PlayerDic.TryGetValue(sGUID, out entity)) { entity.SetMp((float)info.curmp); entity.SetMpMax((float)info.maxmp); BloodBarPlayer playerXueTiao = (BloodBarPlayer)entity.BloodBar; //更新实体的蓝条 //playerXueTiao.UpdateMp(); } } EventCenter.Broadcast((Int32)GameEventEnum.UserEvent_NotifyMPInfo, pMsg); return((Int32)EErrorCode.eNormal); }