コード例 #1
0
ファイル: AttrAbility.cs プロジェクト: clk664251332/NewArad
    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();
    }
コード例 #2
0
ファイル: AttrAbility.cs プロジェクト: clk664251332/NewArad
 //重新计算某个属性,会触发该属性的变化事件
 public void ReCalculate(EActorAttr eActorAttr)
 {
     m_attributeAll.Calculate(eActorAttr);
 }