예제 #1
0
        public override object GetNetValue()
        {
            int   num1 = (int)BitBuffer.GetMaxValue(this._bits) / 2;
            float val  = (float)this.value;
            float num2;

            if (this.isRotation)
            {
                if ((double)val < 0.0)
                {
                    double num3 = (double)this._range / 2.0;
                    val = val % -this._range + this._range;
                }
                num2 = val % this._range / this._range;
            }
            else
            {
                num2 = Maths.Clamp(val, -this._range, this._range) / this._range;
            }
            return((object)(int)Math.Round((double)num2 * (double)num1));
        }
예제 #2
0
 public override object ReadNetValue(object val) => (object)(float)((double)((float)(int)val / (float)(BitBuffer.GetMaxValue(this._bits) / 2L)) * (double)this._range);