Ejemplo n.º 1
0
        public object StepNext()
        {
            T val = (T)addMethod.Invoke(null, new object[2]
            {
                (T)baseTweakable.GetValue(),
                StepSize
            });

            baseTweakable.SetValue(val);
            return(baseTweakable.GetValue());
        }
Ejemplo n.º 2
0
 public object SetValueByName(string valueName)
 {
     for (int i = 0; i < tweakableInfo.ToggleValues.Length; i++)
     {
         if (tweakableInfo.ToggleValues[i].Name == valueName)
         {
             currentIndex = i;
             baseTweakable.SetValue(tweakableInfo.ToggleValues[i].Value);
             return(baseTweakable.GetValue());
         }
     }
     throw new TweakableSetException(baseTweakable.Name, "Invalid toggle value name: '" + valueName + "'");
 }
Ejemplo n.º 3
0
 public ToggleTweakable(BaseTweakable <T> baseTweakable)
 {
     this.baseTweakable = baseTweakable;
     tweakableInfo      = baseTweakable.TweakableInfo;
     currentIndex       = GetIndexOfValue(baseTweakable.GetValue());
 }