public void ResetValue(EActorAttr eActorAttr) { for (int i = 0; i < (int)EActorAttr.AttrEnd; i++) { if ((int)eActorAttr == i) { m_lstValues[i].SetValue(0); } } }
public AttrValue GetAttr(EActorAttr eActorAttr) { for (int i = 0; i < (int)EActorAttr.AttrEnd; i++) { if ((int)eActorAttr == i) { return(m_attributeAll.m_lstValues[i]); } } return(null); }
public void Calculate(EActorAttr eActorAttr) { if (GetParent() == null) { ResetValue(eActorAttr); } foreach (AttributeNode childNode in m_childNodeList) { if (childNode.GetChildNodeCount() > 0) { ResetValue(eActorAttr); childNode.Calculate(eActorAttr); } for (int i = 0; i < (int)EActorAttr.AttrEnd; i++) { if ((int)eActorAttr == i) { m_lstValues[i].PlusValue(childNode.m_lstValues[i].Value); } } } }
public void SetAttrValue(EActorAttr eActorAttr, float value) { m_lstValues[(int)eActorAttr].SetValue(value); }
public AttrValue GetAttr(EActorAttr eActorAttr) { AttrAbility attrAbility = GetAbility <AttrAbility>(); return(attrAbility.GetAttr(eActorAttr)); }
//重新计算某个属性,会触发该属性的变化事件 public void ReCalculate(EActorAttr eActorAttr) { m_attributeAll.Calculate(eActorAttr); }
public AttrValue(EActorAttr eActorAttr, AttrAbility attrAbility, bool isListen = false) { m_eActorAttr = eActorAttr; m_attrAbility = attrAbility; m_bListen = isListen; }