Ejemplo n.º 1
0
 public static void AddRotary(MenuCommand menuCommand)
 {
     OSCWindowControlCreator.ShowWindow(menuCommand, (data, command) =>
     {
         InitUIElement <OSCRotary, OSCTransmitterInformerFloat>(OSCControls.CreateRotary, data, command);
     });
 }
Ejemplo n.º 2
0
 public static void AddPad(MenuCommand menuCommand)
 {
     OSCWindowControlCreator.ShowWindow(menuCommand, (data, command) =>
     {
         InitUIElement <OSCPad, OSCTransmitterInformerVector2>(OSCControls.CreatePad, data, command);
     });
 }
Ejemplo n.º 3
0
 public static void AddButton(MenuCommand menuCommand)
 {
     OSCWindowControlCreator.ShowWindow(menuCommand, (data, command) =>
     {
         InitUIElement <OSCButton, OSCTransmitterInformerBool>(OSCControls.CreateButton, data, command);
     });
 }
Ejemplo n.º 4
0
 public static void AddMultiplySlidersHorizontal(MenuCommand menuCommand)
 {
     OSCWindowControlCreator.ShowWindow(menuCommand, (data, command) =>
     {
         InitMultiplySlidersUIElement(OSCControls.CreateMultiplySlidersHorizontal, data, command);
     });
 }
Ejemplo n.º 5
0
 public static void AddSlider(MenuCommand menuCommand)
 {
     OSCWindowControlCreator.Open(menuCommand, (data, command) =>
     {
         InitUIElement <OSCSlider, OSCTransmitterInformerFloat>(OSCControls.CreateSlider, data, command);
     });
 }
Ejemplo n.º 6
0
        protected override void DrawContent(ref Rect contentRect)
        {
            if (!_controlCreator.IsValid)
            {
                EditorGUILayout.LabelField(_errorCreateContent, OSCEditorStyles.CenterLabel, GUILayout.Height(contentRect.height));

                return;
            }

            contentRect.x      += 2;
            contentRect.y      += 2;
            contentRect.width  -= 4;
            contentRect.height -= 4;

            GUILayout.BeginArea(contentRect);

            OSCEditorInterface.LogoLayout();

            GUILayout.Label(_controlSettingsContent, EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(OSCEditorStyles.Box);

            ControlColor = EditorGUILayout.ColorField(_controlColorContent, ControlColor);

            EditorGUILayout.EndVertical();

            GUI.color = AddInformer ? Color.green : Color.red;
            if (GUILayout.Button(_addInformerContent))
            {
                AddInformer = !AddInformer;
            }

            GUI.color = Color.white;

            if (AddInformer)
            {
                GUILayout.Label(_informerSettingsContent, EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(OSCEditorStyles.Box);

                OSCEditorUtils.FindObjects(TransmitterCallback, true, out var content, out OSCTransmitter[] objects);

                InformerAddress     = EditorGUILayout.TextField(_oscAddressContent, InformerAddress);
                InformerTransmitter = OSCEditorInterface.PopupLayout(_oscTransmitterContent,
                                                                     InformerTransmitter,
                                                                     content,
                                                                     objects);

                GUI.color = InformOnChanged ? Color.green : Color.red;
                if (GUILayout.Button(_informOnChangedContent))
                {
                    InformOnChanged = !InformOnChanged;
                }

                GUI.color = Color.white;

                if (!InformOnChanged)
                {
                    InformerInterval = EditorGUILayout.FloatField(_informerIntervalContent, InformerInterval);

                    if (InformerInterval < 0)
                    {
                        InformerInterval = 0;
                    }

                    EditorGUILayout.HelpBox("Set to 0 for send message with each frame.", MessageType.Info);
                }

                EditorGUILayout.EndVertical();
            }

            GUI.color = Color.green;
            if (GUILayout.Button(_createContent))
            {
                var data = new OSCWindowControlCreator.ControlData();
                data.ControlColor        = ControlColor;
                data.UseInformer         = AddInformer;
                data.InformAddress       = InformerAddress;
                data.InformInterval      = InformerInterval;
                data.InformOnChanged     = InformOnChanged;
                data.InformerTransmitter = InformerTransmitter;

                OSCWindowControlCreator.CreateControl(data);
            }

            GUI.color = Color.white;

            GUILayout.EndArea();
        }
Ejemplo n.º 7
0
 public OSCPanelControlCreator(OSCWindow window, string panelId) : base(window, panelId)
 {
     _controlCreator = window as OSCWindowControlCreator;
 }
		public OSCPanelControlCreator(OSCWindow window) : base(window)
		{
			_controlCreator = window as OSCWindowControlCreator;
		}
Ejemplo n.º 9
0
 public OSCPanelControlCreator(OSCWindow parentWindow, string panelId) : base(parentWindow, panelId)
 {
     _controlCreator = parentWindow as OSCWindowControlCreator;
 }
Ejemplo n.º 10
0
        protected override void DrawContent(Rect contentRect)
        {
            if (!_controlCreator.IsValid)
            {
                EditorGUILayout.LabelField(_errorCreateContent, OSCEditorStyles.CenterLabel, GUILayout.Height(contentRect.height));

                return;
            }

            var defaultColor = GUI.color;

            contentRect.x      += 2;
            contentRect.y      += 2;
            contentRect.width  -= 4;
            contentRect.height -= 4;

            GUILayout.BeginArea(contentRect);

            GUILayout.Space(10);
            OSCEditorLayout.DrawLogo();
            GUILayout.Space(5);

            GUILayout.Label(_controlSettingsContent, EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical("box");

            _controlColor = EditorGUILayout.ColorField(_controlColorContent, _controlColor);

            EditorGUILayout.EndVertical();

            GUI.color = _addInformer ? Color.green : Color.red;
            if (GUILayout.Button(_addInformerContent))
            {
                _addInformer = !_addInformer;
            }
            GUI.color = defaultColor;

            if (_addInformer)
            {
                GUILayout.Label(_informerSettingsContent, EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical("box");

                _informerAddress     = EditorGUILayout.TextField(_oscAddressContent, _informerAddress);
                _informerTransmitter = OSCEditorLayout.TransmittersPopup(_informerTransmitter, _oscTransmitterContent);

                GUI.color = _informOnChanged ? Color.green : Color.red;
                if (GUILayout.Button(_informOnChangedContent))
                {
                    _informOnChanged = !_informOnChanged;
                }
                GUI.color = defaultColor;

                if (!_informOnChanged)
                {
                    _informerInterval = EditorGUILayout.FloatField(_informerIntervalContent, _informerInterval);

                    if (_informerInterval < 0)
                    {
                        _informerInterval = 0;
                    }

                    EditorGUILayout.HelpBox("Set to 0 for send message with each frame.", MessageType.Info);
                }

                EditorGUILayout.EndVertical();
            }

            GUI.color = Color.green;
            if (GUILayout.Button(_createContent))
            {
                var data = new OSCWindowControlCreator.ControlData();
                data.ControlColor        = _controlColor;
                data.UseInformer         = _addInformer;
                data.InformAddress       = _informerAddress;
                data.InformInterval      = _informerInterval;
                data.InformOnChanged     = _informOnChanged;
                data.InformerTransmitter = _informerTransmitter;

                OSCWindowControlCreator.Invoke(data);
            }
            GUI.color = defaultColor;

            GUILayout.EndArea();
        }