Beispiel #1
0
        public void Waterfall()
        {
            WaterfallController controller = new WaterfallController();

            ViewResult result = controller.Waterfall() as ViewResult;

            Assert.IsNotNull(result);
        }
 public void SetDeleteMode(WaterfallController ctrl, ModuleWaterfallFX mod)
 {
     showWindow = true;
     control    = ctrl;
     fxMod      = mod;
     windowMode = ControllerPopupMode.Delete;
     GUI.BringWindowToFront(windowID);
 }
Beispiel #3
0
 public void OpenControllerEditWindow(WaterfallController toEdit)
 {
     if (controlAddWindow == null)
     {
         controlAddWindow = new UIControllerPopupWindow(true);
     }
     controlAddWindow.SetEditMode(toEdit, selectedModule);
 }
Beispiel #4
0
 public void OpenControllerDeleteWindow(WaterfallController toDelete)
 {
     if (controlAddWindow == null)
     {
         controlAddWindow = new UIControllerPopupWindow(true);
     }
     controlAddWindow.SetDeleteMode(toDelete, selectedModule);
 }
 public void SetDeleteMode(WaterfallController ctrl, ModuleWaterfallFX mod)
 {
     showWindow     = true;
     control        = ctrl;
     fxMod          = mod;
     windowMode     = ControllerPopupMode.Delete;
     WindowPosition = new Rect(Screen.width / 2 - 100, Screen.height / 2f - 50, 200, 100);
 }
 public void LoadOptions(WaterfallController controller)
 {
     if (controller is TController concreteController)
     {
         LoadOptions(concreteController);
     }
     else
     {
         throw new ArgumentException(nameof(controller));
     }
 }
        public void SetEditMode(WaterfallController ctrl, ModuleWaterfallFX mod)
        {
            windowMode        = ControllerPopupMode.Modify;
            showWindow        = true;
            control           = ctrl;
            fxMod             = mod;
            newControllerName = ctrl.name;

            selectedControllerIndex = controllerTypes.IndexOf(ctrl.GetType());
            GUI.BringWindowToFront(windowID);

            controllerOptions[selectedControllerIndex].LoadOptions(ctrl);
        }
        public void SetEditMode(WaterfallController ctrl, ModuleWaterfallFX mod)
        {
            showWindow        = true;
            control           = ctrl;
            fxMod             = mod;
            newControllerName = ctrl.name;
            controllerFlag    = controllerTypes.ToList().IndexOf(ctrl.linkedTo);
            windowMode        = ControllerPopupMode.Modify;
            WindowPosition    = new Rect(Screen.width / 2 - 100, Screen.height / 2f - 50, 400, 100);
            eventCurve        = new FloatCurve();

            if (control is RandomnessController r)
            {
                if (r.noiseType == "random")
                {
                    randomStrings[0] = r.range.x.ToString();
                    randomStrings[1] = r.range.y.ToString();
                }
                if (r.noiseType == "perlin")
                {
                    randomStrings[0] = r.seed.ToString();
                    randomStrings[1] = r.scale.ToString();
                    randomStrings[2] = r.speed.ToString();
                    randomStrings[3] = r.minimum.ToString();
                }
            }
            else if (control is EngineEventController e)
            {
                eventCurve          = e.eventCurve;
                eventDuration       = e.eventDuration;
                eventDurationString = e.eventDuration.ToString();
            }
            else if (control is ThrottleController t)
            {
                throttleStrings[0] = t.responseRateUp.ToString();
                throttleStrings[1] = t.responseRateDown.ToString();
            }
            else if (control is RCSController rcs)
            {
                throttleStrings[0] = rcs.responseRateUp.ToString();
                throttleStrings[1] = rcs.responseRateDown.ToString();
            }

            GenerateCurveThumbs();
        }
Beispiel #9
0
        void DrawController(WaterfallController ctrl)
        {
            GUILayout.BeginHorizontal();


            ctrl.overridden = GUILayout.Toggle(ctrl.overridden, "", GUILayout.Width(60));

            GUILayout.Label(ctrl.name, GUILayout.MaxWidth(120f));
            //GUILayout.Label(ctrl.linkedTo, GUILayout.MaxWidth(130f));


            float sliderMax = 1f;
            float sliderMin = 0f;

            if (ctrl.linkedTo == "mach")
            {
                sliderMax = 15f;
            }
            if (ctrl.linkedTo == "gimbal")
            {
                sliderMin = -1f;
            }

            if (ctrl.overridden)
            {
                ctrl.overrideValue = GUILayout.HorizontalSlider(ctrl.overrideValue, sliderMin, sliderMax, GUILayout.MaxWidth(100f));
            }
            else
            {
                ctrl.overrideValue = GUILayout.HorizontalSlider(ctrl.Get()[0], 0f, sliderMax, GUILayout.MaxWidth(100f));
            }
            GUILayout.Label(ctrl.overrideValue.ToString("F2"), GUILayout.MinWidth(40f));

            if (GUILayout.Button("Edit", GUILayout.Width(30)))
            {
                OpenControllerEditWindow(ctrl);
            }
            if (GUILayout.Button("x", GUILayout.Width(20)))
            {
                OpenControllerDeleteWindow(ctrl);
            }

            GUILayout.EndHorizontal();
        }