예제 #1
0
        /// <summary>
        /// 设置值
        /// </summary>
        /// <param name="value">值</param>
        /// <param name="force">强制</param>
        public virtual void setValue(float value, bool force = false)
        {
            this.immediately = force;
            Debug.Log("setValue: " + value);
            switch (setValueType)
            {
            case SetValueType.Value:
                param.rate = calcRate(param.value = value); break;

            case SetValueType.ValueIncr:
                param.rate = calcRate(param.value = param.oriValue + value); break;

            case SetValueType.Rate:
                param.value = calcValue(param.rate = value); break;

            case SetValueType.RateIncr:
                param.value = calcValue(param.rate = param.oriRate + value); break;
            }
            Debug.Log("param: " + param.toJson().ToJson());
            requestRefresh();
        }