コード例 #1
0
        public override int calculate(ITezProperty <int> property)
        {
            float result = property.baseValue + m_SumBase + property.baseValue * m_MultBase;

            result = result + m_SumTotal + result * m_MultTotal;
            return(Mathf.RoundToInt(result));
        }
コード例 #2
0
        /// <summary>
        /// 移除一个Modifier
        /// 并返回被操作的Property
        /// </summary>
        public bool removeModifier(ITezValueModifier modifier, out ITezProperty property)
        {
            var target = modifier.modifierConfig.target;

            property = this.get <ITezProperty>(target);
            return((property != null) && property.removeModifier(modifier));
        }
コード例 #3
0
        /// <summary>
        /// 加入一个modifier
        /// 并返回被操作的property
        /// </summary>
        public bool addModifier(ITezValueModifier modifier, out ITezProperty property)
        {
            var target = modifier.modifierConfig.target;

            property = this.get <ITezProperty>(target);
            property?.addModifier(modifier);
            return(property != null);
        }
コード例 #4
0
        private void onRefValueChanged(ITezProperty property)
        {
            var old = m_Value;

            switch (m_Property.valueType)
            {
            case TezValueType.Int:
                m_Value = ((ITezProperty <int>)m_Property).value;
                break;

            case TezValueType.Float:
                m_Value = ((ITezProperty <float>)m_Property).value;
                break;
            }

            this.notifyValueChanged(this, old);
        }
コード例 #5
0
 public abstract T calculate(ITezProperty <T> property);