public override void Initialize() { base.Initialize(); m_attributeAll = new AttributeNode(this, true);//最终结果属性进行事件监听 m_attributeGrowth = new GrowthAttrNode(this); m_attributeEquip = new EquipAttrNode(this); m_attributeBuff = new BuffAttrNode(this); //添加子节点 m_attributeAll.AddChildNode(m_attributeGrowth); m_attributeAll.AddChildNode(m_attributeEquip); m_attributeAll.AddChildNode(m_attributeBuff); //各个分支属性的初始化 m_attributeGrowth.Initialize(); m_attributeEquip.Initialize(); m_attributeBuff.Initialize(); //计算 m_attributeAll.Calculate(); }