Пример #1
0
        public virtual void Initialize(StatsHandler handler, Stat stat)
        {
            this.m_Handler = handler;
            this.m_Stat    = stat;
            switch (this.m_ValueType)
            {
            case ValueType.Value:
                stat.onValueChange += OnValueChange;
                break;

            case ValueType.CurrentValue:
                if (stat is Attribute attribute)
                {
                    attribute.onCurrentValueChange += OnCurrentValueChange;
                }
                break;
            }
            this.m_Sequence          = new Sequence(handler.gameObject, new PlayerInfo("Player"), handler.GetComponent <Blackboard>(), this.m_Actions.actions.ToArray());
            this.m_Handler.onUpdate += Update;
        }