Exemple #1
0
        private void DrawReceiver(OSCEditorReceiver receiver)
        {
            // SETTINGS BLOCK
            using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
            {
                // RECEIVER SETTINGS
                EditorGUILayout.LabelField("Receiver Settings:", EditorStyles.boldLabel);
                using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
                {
                    if (receiver.LocalHostMode == OSCLocalHostMode.Any)
                    {
                        using (new GUILayout.HorizontalScope())
                        {
                            EditorGUILayout.LabelField(_localHostContent, GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                            EditorGUILayout.SelectableLabel(_localHost, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                        }
                    }
                    else
                    {
                        receiver.LocalHost = EditorGUILayout.TextField(_localHostContent, receiver.LocalHost);
                    }

                    receiver.LocalPort = EditorGUILayout.IntField(_localPortContent, receiver.LocalPort);
                    // TODO: MapBundle field?
                }

                // ADVANCED BLOCK
                EditorGUILayout.LabelField(_advancedContent, EditorStyles.boldLabel);
                using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
                {
                    receiver.LocalHostMode = (OSCLocalHostMode)EditorGUILayout.EnumPopup(_localHostModeContent, receiver.LocalHostMode);
                }
            }
        }
Exemple #2
0
        private void DrawReceivers(OSCEditorReceiver[] receivers)
        {
            using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
            {
                GUI.color = Color.red;
                using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
                {
                    GUILayout.Label("Receivers:", OSCEditorStyles.CenterBoldLabel);
                }
                GUI.color = _defaultColor;

                GUILayout.Space(5f);

                if (receivers.Length > 0)
                {
                    OSCEditorReceiver removingReceiver = null;

                    foreach (var receiver in receivers)
                    {
                        bool remove;

                        DrawBase(receiver, out remove);
                        GUILayout.Space(5f);

                        if (remove)
                        {
                            removingReceiver = receiver;
                        }
                    }

                    if (removingReceiver != null)
                    {
                        OSCEditorManager.RemoveEditorReceiver(removingReceiver);
                    }
                }
                else
                {
                    using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
                    {
                        GUILayout.Label("- none -", OSCEditorStyles.CenterLabel);
                    }
                }

                GUILayout.Space(5f);

                using (new GUILayout.VerticalScope(OSCEditorStyles.Box))
                {
                    GUI.color = Color.green;
                    var addButton = GUILayout.Button("Add Receiver");
                    GUI.color = _defaultColor;

                    if (addButton)
                    {
                        OSCEditorManager.CreateEditorReceiver();
                    }
                }
            }
        }
Exemple #3
0
 public OSCEditorReceiver EditorReceiversPopup(OSCEditorReceiver receiver, GUIContent content)
 {
     return(EditorOSCPopup(extOSC.InEditor.OSCEditorUtils.GetReceivers(), receiver, content));
 }