//数值属性回调函数 用于战场 public void ResponseEntityNumPropEvent(EntityNumPropEventArgs e) { if (e.objev == null || m_wndView == null || !e.objev.IsHero) { return; } entity_view_update_Numproperty data = e.data; int nUpdateValue = data.nValue; switch (data.nPropID) { case (int)ENTITY_PROPERTY.PROPERTY_LEVEL: { onUpdateLevel(nUpdateValue); UpdateTalentPropertyDesc(); } break; case (int)ENTITY_PROPERTY.PROPERTY_VOCATION: { if (nUpdateValue > 0) { if (LogicDataCenter.heroTalentDataManager.nCurHeroId == nUpdateValue) { return; } LogicDataCenter.heroTalentDataManager.nCurHeroId = nUpdateValue; // 初始化新英雄的天赋数据 InitShowDataInfo(nUpdateValue); // 清空已激活天赋 LogicDataCenter.heroTalentDataManager.clearSelfActivedTalentList(); } } break; case (int)ENTITY_PROPERTY.PROPERTY_PA: case (int)ENTITY_PROPERTY.PROPERTY_MA: case (int)ENTITY_PROPERTY.PROPERTY_PD: case (int)ENTITY_PROPERTY.PROPERTY_MD: case (int)ENTITY_PROPERTY.PROPERTY_SD: case (int)ENTITY_PROPERTY.PROPERTY_AF: case (int)ENTITY_PROPERTY.PROPERTY_CRC: case (int)ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE: { UpdateTalentPropertyDesc(); } break; default: break; } }
/* * 英雄属性相关 */ private void SetHeroLevel(entity_view_update_Numproperty data, U3D_Render.EntityView objev) { if (objev.IsHero) { if (!Value.IsValueValid(vLevelTF)) { return; } vLevelTF.SetText(data.nValue.ToString()); } }
private void SetHeroVocationProtrait(entity_view_update_Numproperty data, U3D_Render.EntityView objev) { if (objev.IsHero) { if (!Value.IsValueValid(vHeroProtraitBtn)) { return; } int nVocationID = EntityFactory.getEntityViewByID(EntityFactory.MainHeroID).Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION); Trace.LogWarning("SetHeroVocationProtrait:" + nVocationID); vHeroProtraitBtn.SetMember("aHeroID", nVocationID); } }
private void SetGoodsStoreMoney(entity_view_update_Numproperty data, U3D_Render.EntityView objev) { if (objev.IsHero) { if (!Value.IsValueValid(vGoodsStoreBtn)) { return; } string strMoney = data.nValue.ToString();; vGoodsStoreBtn.SetMember("label", strMoney); } }
private void SetHeroExp(entity_view_update_Numproperty data, U3D_Render.EntityView objev) { if (objev.IsHero) { if (!Value.IsValueValid(vExpBar)) { return; } //ExpBar.SetMember("minimum", 0); //ExpBar.SetMember("maximum", data.nOtherData); //ExpBar.SetMember("value", data.nValue); if (vExpBar.Invoke("SetStatusValue", data.nValue, data.nOtherData, 0) == null) { Trace.LogError("call ExpBar.SetStatusValue failed"); return; } } }
//数值属性回调函数 public void ResponseEntityNumPropEvent(EntityNumPropEventArgs e) { if (e.objev == null || m_wndView == null || !e.objev.IsHero || !bMobaState) { return; } entity_view_update_Numproperty data = e.data; int nUpdateValue = data.nValue; switch (data.nPropID) { case (int)ENTITY_PROPERTY.PROPERTY_VOCATION: { SetHeroVocationProtrait(nUpdateValue); } break; case (int)ENTITY_PROPERTY.PROPERTY_EXP: { SetHeroExp(nUpdateValue, data.nOtherData); } break; case (int)ENTITY_PROPERTY.PROPERTY_LEVEL: { SetHeroLevel(nUpdateValue); } break; case (int)ENTITY_PROPERTY.PROPERTY_STAMINA: { m_currentStamina = nUpdateValue; SetHeroStamina(); } break; case (int)ENTITY_PROPERTY.PROPERTY_MAX_STAMINA: { m_maxStamina = nUpdateValue; SetHeroStamina(); } break; case (int)ENTITY_PROPERTY.PROPERTY_MP: case (int)ENTITY_PROPERTY.PROPERTY_ENERGY: { m_currentMp = nUpdateValue; SetHeroMP(); } break; case (int)ENTITY_PROPERTY.PROPERTY_MAX_MP: case (int)ENTITY_PROPERTY.PROPERTY_MAX_ENERGY: { m_maxMp = nUpdateValue; SetHeroMP(); } break; case (int)ENTITY_PROPERTY.PROPERTY_TALENT_POINT: //金钱 { SetGoodsStoreMoney(nUpdateValue); } break; case (int)ENTITY_PROPERTY.PROPERTY_HP: { m_currentHp = nUpdateValue; SetHeroHP(); } break; case (int)ENTITY_PROPERTY.PROPERTY_MAX_HP: { m_maxHp = nUpdateValue; SetHeroHP(); } break; case (int)ENTITY_PROPERTY.PROPERTY_SHIELD: { SetHeroHP(); } break; case (int)ENTITY_PROPERTY.PROPERTY_PA: case (int)ENTITY_PROPERTY.PROPERTY_MA: case (int)ENTITY_PROPERTY.PROPERTY_PD: case (int)ENTITY_PROPERTY.PROPERTY_MD: case (int)ENTITY_PROPERTY.PROPERTY_SD: case (int)ENTITY_PROPERTY.PROPERTY_PCT_AF: case (int)ENTITY_PROPERTY.PROPERTY_CRC: case (int)ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE: { ENTITY_PROPERTY index = (ENTITY_PROPERTY)e.data.nPropID; float fValue = e.data.nValue; if (!Mathf.Approximately(m_dicPropertyValue[index], fValue)) { m_dicPropertyValue[index] = fValue; if (e.data.nPropID == (int)ENTITY_PROPERTY.PROPERTY_CRC || e.data.nPropID == (int)ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE || e.data.nPropID == (int)ENTITY_PROPERTY.PROPERTY_PCT_AF) { fValue /= 100; } // 取得配置区间值 if (EntityFactory.MainHeroView == null) { break; } int nHeroID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION); int nPropIndex = m_dicPropertyIndex[(ENTITY_PROPERTY)data.nPropID]; SSchemePropertyPanel propConfig = PropertyPanelConfig.Instance.GetPropertyPanelConfigList(nHeroID, fValue, nPropIndex); if (propConfig == null) { Debug.LogError(String.Format("propConfig == null,{0},{1}, {2}", nHeroID, fValue, nPropIndex)); break; } string strValue = ""; if (index == ENTITY_PROPERTY.PROPERTY_PCT_AF) { strValue = String.Format("{0}{1}", (int)fValue, "%"); } else if (index == ENTITY_PROPERTY.PROPERTY_CRC || index == ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE) { strValue = fValue.ToString("0") + "%"; } else { strValue = fValue.ToString(); } string strNewText = String.Format("<color='#{0}'>{1}</color>", propConfig.strColor, strValue); m_wndView.SetPropertyValue(nPropIndex - 1, strNewText); } } break; default: break; } }
//数值属性回调函数 public void ResponseEntityNumPropEvent(EntityNumPropEventArgs e) { if (e.objev == null || m_wndView == null) { return; } EntityView ev = e.objev; int nUID = e.data.nEntityID; switch (e.data.nPropID) { case (int)ENTITY_PROPERTY.PROPERTY_HP: case (int)ENTITY_PROPERTY.PROPERTY_MAX_HP: { m_wndView.SetHPBar(nUID, ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_HP), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_HP)); } break; case (int)ENTITY_PROPERTY.PROPERTY_MP: case (int)ENTITY_PROPERTY.PROPERTY_MAX_MP: { m_wndView.SetMPBar(nUID, ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_MP), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MP)); } break; case (int)ENTITY_PROPERTY.PROPERTY_LEVEL: { m_wndView.SetLevel(nUID, ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL)); } break; default: break; } if (m_wndView.CurrentPlayer != null && m_wndView.CurrentPlayer.nEntityID == nUID) { entity_view_update_Numproperty data = e.data; int nUpdateValue = data.nValue; switch (e.data.nPropID) { case (int)ENTITY_PROPERTY.PROPERTY_HP: case (int)ENTITY_PROPERTY.PROPERTY_MAX_HP: { m_wndView.BottomView.SetHeroHP(ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_HP), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_HP)); } break; case (int)ENTITY_PROPERTY.PROPERTY_MP: case (int)ENTITY_PROPERTY.PROPERTY_MAX_MP: { m_wndView.BottomView.SetHeroMP(ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MP), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_MP)); } break; case (int)ENTITY_PROPERTY.PROPERTY_LEVEL: { m_wndView.BottomView.SetHeroLevel(ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL)); } break; case (int)ENTITY_PROPERTY.PROPERTY_EXP: { m_wndView.BottomView.SetHeroExp(nUpdateValue, data.nOtherData); } break; case (int)ENTITY_PROPERTY.PROPERTY_STAMINA: { m_wndView.BottomView.SetHeroStamina(ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_STAMINA), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_STAMINA)); } break; case (int)ENTITY_PROPERTY.PROPERTY_MAX_STAMINA: { m_wndView.BottomView.SetHeroStamina(ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_STAMINA), ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_STAMINA)); } break; case (int)ENTITY_PROPERTY.PROPERTY_TALENT_POINT: //金钱 { m_wndView.BottomView.SetGoodsStoreMoney(nUpdateValue); } break; case (int)ENTITY_PROPERTY.PROPERTY_PA: case (int)ENTITY_PROPERTY.PROPERTY_MA: case (int)ENTITY_PROPERTY.PROPERTY_PD: case (int)ENTITY_PROPERTY.PROPERTY_MD: case (int)ENTITY_PROPERTY.PROPERTY_SD: case (int)ENTITY_PROPERTY.PROPERTY_PCT_AF: case (int)ENTITY_PROPERTY.PROPERTY_CRC: case (int)ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE: { m_wndView.SetPropertyValue((ENTITY_PROPERTY)e.data.nPropID); } break; default: break; } } }