public object StepNext() { T val = (T)addMethod.Invoke(null, new object[2] { (T)baseTweakable.GetValue(), StepSize }); baseTweakable.SetValue(val); return(baseTweakable.GetValue()); }
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 + "'"); }
public ToggleTweakable(BaseTweakable <T> baseTweakable) { this.baseTweakable = baseTweakable; tweakableInfo = baseTweakable.TweakableInfo; currentIndex = GetIndexOfValue(baseTweakable.GetValue()); }