/// <summary> /// 展示属性信息 by吴江 /// </summary> /// <param name="_triggerUI"></param> /// <param name="_tag"></param> /// <param name="_value"></param> public static void ShowPropertyTooltip(GameObject _triggerUI, ActorPropertyTag _tag, int _value) { CloseAllTooltip(); if (_tag == ActorPropertyTag.TOTAL) { return; } GUIBase panel = GetPanelByType(TooltipType.Property); if (panel == null) { return; } PropertyTooltip propertyTooltip = panel.GetComponent <PropertyTooltip>(); if (propertyTooltip == null) { GameSys.LogError("在预制上找不到组件 : <EquipmentTooltip>!"); return; } propertyTooltip.SetData(_tag, _value, _triggerUI); panel.OpenUI(); SetPropertyTooltipPosition(panel.gameObject, _triggerUI); }
protected virtual void OnPropertyUpdate(ActorPropertyTag _tag, long _value, bool _fromAbility) { if (isDead) { if (headTextCtrl != null) { // headTextCtrl.HideBlood(); } } if (_fromAbility || IsActor) { return; // || !MainPlayerFocus) return; } switch (_tag) { case ActorPropertyTag.HPLIMIT: // if (headTextCtrl != null) // { // headTextCtrl.SetBlood(actorInfo.MaxHP <= 0 ? 0 : actorInfo.CurHP / (float)actorInfo.MaxHP, IsFriend); // } break; default: break; } }
void RefreshSlaValue(ActorPropertyTag tag, int val, bool _from) { if (tag != ActorPropertyTag.SLA) { return; } }
void RefreshPropDate(ActorPropertyTag tag, long value, bool _fromAbility) { switch (tag) { case ActorPropertyTag.HPLIMIT: if (CurPlayerHp != null) { CurPlayerHp.value = (float)actorInfo.CurHP / actorInfo.MaxHP; } if (HpLable != null) { HpLable.text = actorInfo.CurHPText + "/" + actorInfo.MaxHPText; } break; case ActorPropertyTag.MPLIMIT: if (CurPlayerMp != null) { CurPlayerMp.value = (float)actorInfo.CurMP / actorInfo.MaxMP; } if (MpLable != null) { MpLable.text = actorInfo.CurMPText + "/" + actorInfo.MaxMPText; } break; } }
/// <summary> /// 设置展示信息 by吴江 /// </summary> /// <param name="_tag"></param> /// <param name="_value"></param> public void SetData(ActorPropertyTag _tag, int _value, GameObject _triggerObj) { propertyTag = _tag; propertyValue = _value; triggerObj = _triggerObj; //refData = ConfigMng.Instance.GetAttributeTypeRef(propertyTag); }
public void Update(ActorPropertyTag _tag, int _value) { if (_tag == this.tag) { this.value = _value; } }
protected int GetAttributeValue(ActorPropertyTag _tag, List <AttributePair> _attrList) { for (int i = 0, length = _attrList.Count; i < length; i++) { if (_attrList[i].tag == _tag) { return(_attrList[i].value); } } return(0); }
protected void UpdateSpeed(ActorPropertyTag _tag, long _speed, bool _state) { if (_tag != ActorPropertyTag.MOVESPD) { return; } if (actorInfo.Movespd != 0) { CurRealSpeed = Mathf.Max(SmartActor.MOVE_SPEED_BASE, (float)actorInfo.StaticSpeed * (float)actorInfo.Movespd / 100f); } }
/// <summary> /// 获取称号列表 /// </summary> private void S2C_GetTitleList(Pt _pt) { pt_title_list_d422 pt = _pt as pt_title_list_d422; if (pt != null) { AllAttrNum.Clear(); OwnTitleDictionary.Clear(); //GetAllTitle(); List <title_base_info_list> list = pt.title_list; for (int i = 0; i < list.Count; i++) { TitleInfo info = new TitleInfo(list[i]); if (!isFirstTime) { TitleInfo oldInfo = titleDictionary[info.ID] as TitleInfo; if (oldInfo != null) { if (!oldInfo.IsOwn) { NewTitle = info; GameCenter.curMainPlayer.StopForNextMove(); GameCenter.uIMng.GenGUI(GUIType.NEWTITLEMSG, true); } } } titleDictionary[info.ID] = info; OwnTitleDictionary.Add(info); if (list [i].put_state == 1) { CurUseTitle = (titleDictionary [info.ID]) as TitleInfo; } for (int j = 0; j < info.Attribute.Count; j++) { ActorPropertyTag act = (ActorPropertyTag)info.Attribute[j].eid; AllAttrNum.Add(new AttributePair(act, info.Attribute[j].count)); } } if (UpdateTitle != null) { UpdateTitle(); } if (isFirstTime) { isFirstTime = false; } } SortTitle(); GameCenter.coupleMng.GeTTitleRef(); }
/// <summary> /// 根据信物id获取信物升级属性 /// </summary> public int GetTokenAttrValueByTag(ActorPropertyTag _tag) { if (coupleData != null && coupleData.tokenLev > 0) { for (int i = 0, max = coupleData.Attribute.Count; i < max; i++) { if (coupleData.Attribute[i].tag == _tag) { return(coupleData.Attribute[i].value); } } } //Debug.LogError("信物表中找不到id为 : " + _id + " 的数据"); return(0); }
/// <summary> /// 获取属性值 /// </summary> protected void getVal(ActorPropertyTag _tag, SwornRef _swornRef, List <float> _attr) { if (_swornRef != null) { for (int i = 0; i < _swornRef.attrs.Count; i++) { if (_swornRef.attrs[i].tag == _tag) { _attr.Add(_swornRef.attrs[i].value); break; } if (i == _swornRef.attrs.Count - 1) { _attr.Add(0); } } } else { _attr.Add(0); } }
void OnPropertyUpdate(ActorPropertyTag tag, long val, bool fes) { Show(); }
public AttributePair(ActorPropertyTag _tag, int _value) { this.tag = _tag; this.value = _value; }
public AttributePair(AttributePair _temp) { this.tag = _temp.tag; this.value = _temp.value; }
void ShowProperty(ActorPropertyTag tag, long val, bool fes) { Show(); }
/// <summary> /// 获取所有的时装 /// </summary> /// <param name="_pt"></param> protected void S2C_GetFashionList(Pt _pt) { pt_model_clothes_list_d412 pt = _pt as pt_model_clothes_list_d412; //Debug.Log("收到时装协议"); if (pt != null) { fashionLev = pt.model_lev; fashionExp = pt.model_exp; if (fashionDic.Count < 1) { GetAllFashion(); } RefreshTemporaryFashion(); if (fashionDic != null) { //GetAllTitle (); ownFashionList.Clear(); tempFashionList.Clear(); AllAttrNum.Clear(); InUseClothesFashion = null; InUseWeaponFashion = null; } for (int i = 0; i < pt.model_list.Count; i++) { RemainTime time = null; if (pt.model_list[i].remain_time > 0) { time = new RemainTime(pt.model_list[i].remain_time, Time.time); } FashionInfo fashion = new FashionInfo(pt.model_list[i].model_id, pt.model_list[i].own_state, pt.model_list[i].put_state, time); if (!isFirstTime) { if (!cacheFashionDic.ContainsKey(fashion.FashionID)) { if (fashion.FashionType == 1) { CurFashionWndType = FashionWndType.WEAPON; } if (fashion.FashionType == 2) { CurFashionWndType = FashionWndType.CLOTHES; } GameCenter.uIMng.SwitchToSubUI(SubGUIType.SUBFASHION); } } fashionDic[fashion.FashionID] = fashion; if (pt.model_list[i].put_state == 1) { if (fashion.FashionType == 1) { InUseWeaponFashion = fashion; } if (fashion.FashionType == 2) { InUseClothesFashion = fashion; } } if (pt.model_list[i].own_state == 1) { ownFashionList.Add(fashion); } if (fashion.FashionType == 1) { weaponFashionDic[fashion.FashionID] = fashion; if (fashion.RemainTime != null) { if (fashion.TempID != 0) { if (weaponFashionDic.ContainsKey(fashion.TempID)) { weaponFashionDic.Remove(fashion.TempID); } } } else { if (fashion.ForeverTempID != 0) { if (weaponFashionDic.ContainsKey(fashion.ForeverTempID)) { weaponFashionDic.Remove(fashion.ForeverTempID); } } } } if (fashion.FashionType == 2) { clothesFashionDic[fashion.FashionID] = fashion; if (fashion.RemainTime != null) { if (fashion.TempID != 0) { if (clothesFashionDic.ContainsKey(fashion.TempID)) { clothesFashionDic.Remove(fashion.TempID); } } } else { if (fashion.ForeverTempID != 0) { if (clothesFashionDic.ContainsKey(fashion.ForeverTempID)) { clothesFashionDic.Remove(fashion.ForeverTempID); } } } } if (pt.model_list[i].remain_time > 0) { tempFashionList.Add(fashion); // Debug.Log ("时装列表发来的时间为"+pt.model_list [i].remain_time); } // Debug.Log("时装列表的长度为" + pt.model_list.Count + "时装ID为" + pt.model_list[i].model_id); cacheFashionDic[fashion.FashionID] = fashion; } if (ownFashionList.Count > 0) { for (int i = 0; i < ownFashionList.Count; i++) { for (int j = 0; j < ownFashionList[i].Attribute.Count; j++) { ActorPropertyTag act = (ActorPropertyTag)ownFashionList[i].Attribute[j].eid; AllAttrNum.Add(new AttributePair(act, ownFashionList[i].Attribute[j].count)); } } } if (tempFashionList.Count > 0) { for (int i = 0; i < tempFashionList.Count; i++) { for (int j = 0; j < tempFashionList[i].Attribute.Count; j++) { ActorPropertyTag act = (ActorPropertyTag)tempFashionList[i].Attribute[j].eid; AllAttrNum.Add(new AttributePair(act, tempFashionList[i].Attribute[j].count)); } } } } if (isFirstTime) { isFirstTime = false; } SortFashion(); if (OnUpdateFashionList != null) { OnUpdateFashionList(); } //Debug.Log("此时的衣服时装ID" + GameCenter.mainPlayerMng.MainPlayerInfo.GetServerData().clothesFashionID + "武器ID" + GameCenter.mainPlayerMng.MainPlayerInfo.GetServerData().weaponFashionID); }