Example #1
0
        public InspectorStepperView MakeStepperView(ITweakable tweakable)
        {
            InspectorStepperView inspectorStepperView = inspectorView.InstantiateInspectorComponent(inspectorView.StepperPrefab);

            inspectorStepperView.NextClicked += delegate
            {
                if (tweakable.HasStep)
                {
                    IStepTweakable step2 = tweakable.Step;
                    step2.StepNext();
                }
            };
            inspectorStepperView.PrevClicked += delegate
            {
                if (tweakable.HasStep)
                {
                    IStepTweakable step = tweakable.Step;
                    step.StepPrevious();
                }
            };
            return(inspectorStepperView);
        }
 private void CreateComponents()
 {
     if (TweakableType.IsEnum)
     {
         string[] names  = Enum.GetNames(TweakableType);
         Array    values = Enum.GetValues(TweakableType);
         int      num    = names.Length;
         TweakableInfo.ToggleValues = new TweakableNamedToggleValue <T> [num];
         for (int i = 0; i < num; i++)
         {
             TweakableInfo.ToggleValues[i] = new TweakableNamedToggleValue <T>(names[i], (T)values.GetValue(i));
         }
     }
     if (HasStep && !HasToggle)
     {
         stepTweakable = new StepTweakable <T>(this);
     }
     else if (HasToggle)
     {
         toggleTweakable = new ToggleTweakable <T>(this);
         stepTweakable   = toggleTweakable;
     }
 }