public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUI.BeginChangeCheck();

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

            GUILayout.BeginVertical("box");

            // SETTINGS BLOCK
            EditorGUILayout.LabelField(_receiverComponentSettingsContent, EditorStyles.boldLabel);
            OSCEditorLayout.ReceiverSettings(_receiverProperty, _addressProperty);

            DrawSettings();

            EditorGUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUI.BeginChangeCheck();

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

            EditorGUILayout.LabelField(string.Format("{0} Settings:", target.GetType().Name), EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

            // RECEIVER SETTINGS BLOCK
            EditorGUILayout.LabelField(_receiverComponentSettingsContent, EditorStyles.boldLabel);
            OSCEditorLayout.ReceiverSettings(_receiverProperty, _receiverAddressProperty);

            // TRANSMITTER SETTINGS BLOCK
            EditorGUILayout.LabelField(_transmitterComponentSettingsContent, EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

            OSCEditorLayout.TransmittersPopup(_transmitterProperty, _transmitterContent);

            var transmitterAddress = "- None -";

            if (Application.isPlaying)
            {
                transmitterAddress = _ping.TransmitterAddress;
            }

            EditorGUILayout.LabelField(EditorGUIUtility.currentViewWidth > 410 ?
                                       _transmitterAddressContent.text : _transmitterAddressContentSmall.text,
                                       transmitterAddress);

            // SETTINGS BOX END
            EditorGUILayout.EndVertical();

            DrawSettings();

            EditorGUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUI.BeginChangeCheck();

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

            GUILayout.BeginVertical("box");

            // SETTINGS BLOCK
            EditorGUILayout.LabelField(_receiverComponentSettingsContent, EditorStyles.boldLabel);

            GUILayout.BeginVertical("box");
            OSCEditorLayout.ReceiverSettings(_receiverProperty, _addressProperty, false);
            EditorGUILayout.PropertyField(_mapBundleProperty, _mapBundleContent);

            if (_receiverComponent.Receiver != null && _receiverComponent.Receiver.MapBundle != null &&
                _receiverComponent.MapBundle != null)
            {
                EditorGUILayout.HelpBox("OSCReceiver already has MapBundle.", MessageType.Info);
            }

            EditorGUILayout.EndVertical();

            DrawSettings();

            EditorGUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
        }