/// <summary>
        /// Sets the level (above threshold : remap one, under threshold : remap zero)
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);
            _newValue = (level > receiver.Threshold) ? receiver.StringRemapOne : receiver.StringRemapZero;

            SetValueOptimized(property, _newValue);
        }
        /// <summary>
        /// Sets the level, based on remap zero and remap one, angles in degree
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);

            _newValue = (receiver.RelativeValue) ? _initialValue : Quaternion.identity;

            if (receiver.ModifyX)
            {
                float newX = MMMaths.Remap(level, 0f, 1f, receiver.QuaternionRemapZero.x, receiver.QuaternionRemapOne.x);
                _newValue = _newValue * Quaternion.AngleAxis(newX, Vector3.right);
            }

            if (receiver.ModifyY)
            {
                float newY = MMMaths.Remap(level, 0f, 1f, receiver.QuaternionRemapZero.y, receiver.QuaternionRemapOne.y);
                _newValue = _newValue * Quaternion.AngleAxis(newY, Vector3.up);
            }

            if (receiver.ModifyZ)
            {
                float newZ = MMMaths.Remap(level, 0f, 1f, receiver.QuaternionRemapZero.z, receiver.QuaternionRemapOne.z);
                _newValue = _newValue * Quaternion.AngleAxis(newZ, Vector3.forward);
            }

            SetValueOptimized(property, _newValue);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets the specified level
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);

            _newValue = (int)MMMaths.Remap(level, 0f, 1f, receiver.IntRemapZero, receiver.IntRemapOne);

            if (receiver.RelativeValue)
            {
                _newValue = _initialValue + _newValue;
            }

            SetValueOptimized(property, _newValue);
        }
        /// <summary>
        /// Sets the level, lerping between ColorRemapZero and One
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);

            _newValue = Color.LerpUnclamped(receiver.ColorRemapZero, receiver.ColorRemapOne, level);

            if (receiver.RelativeValue)
            {
                _newValue = _initialValue + _newValue;
            }

            SetValueOptimized(property, _newValue);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets the level
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);

            _newValue.x = receiver.ModifyX ? MMMaths.Remap(level, 0f, 1f, receiver.Vector3RemapZero.x, receiver.Vector3RemapOne.x) : 0f;
            _newValue.y = receiver.ModifyY ? MMMaths.Remap(level, 0f, 1f, receiver.Vector3RemapZero.y, receiver.Vector3RemapOne.y) : 0f;
            _newValue.z = receiver.ModifyZ ? MMMaths.Remap(level, 0f, 1f, receiver.Vector3RemapZero.z, receiver.Vector3RemapOne.z) : 0f;

            if (receiver.RelativeValue)
            {
                _newValue = _initialValue + _newValue;
            }

            SetValueOptimized(property, _newValue);
        }
        /// <summary>
        /// Sets the specified level
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="property"></param>
        /// <param name="level"></param>
        public override void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
        {
            base.SetLevel(receiver, property, level);

            _newValue.x = receiver.ModifyX ? MMMaths.Remap(level, 0f, 1f, receiver.Vector2RemapZero.x, receiver.Vector2RemapOne.x) : 0f;
            _newValue.y = receiver.ModifyY ? MMMaths.Remap(level, 0f, 1f, receiver.Vector2RemapZero.y, receiver.Vector2RemapOne.y) : 0f;

            if (receiver.RelativeValue)
            {
                _newValue = _initialValue + _newValue;
            }

            if (_getterSetterInitialized)
            {
                SetVector2Delegate(_newValue);
            }
            else
            {
                SetPropertyValue(property, _newValue);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets the raw property value, float normalized, caching the operation if possible
 /// </summary>
 /// <param name="receiver"></param>
 /// <param name="property"></param>
 /// <param name="level"></param>
 public override void SetValue(MMPropertyReceiver receiver, MMProperty property, object newValue)
 {
     SetValueOptimized(property, (int)newValue);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Sets the raw property value, float normalized, caching the operation if possible
 /// </summary>
 /// <param name="receiver"></param>
 /// <param name="property"></param>
 /// <param name="level"></param>
 public virtual void SetValue(MMPropertyReceiver receiver, MMProperty property, object newValue)
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Sets the property's level, float normalized, caching the operation if possible
 /// </summary>
 /// <param name="receiver"></param>
 /// <param name="property"></param>
 /// <param name="level"></param>
 public virtual void SetLevel(MMPropertyReceiver receiver, MMProperty property, float level)
 {
     receiver.Level = level;
 }