Пример #1
0
        protected override void DrawSettings()
        {
            _defaultColor = GUI.color;

            // TARGET
            EditorGUILayout.LabelField(_targetTitleContent, EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

            OSCEditorLayout.ReflectionMember(_reflectionMemberProperty, _informer.InformerType, OSCReflectionAccess.Read);

            /*
             * var targetProperty = _reflectionMemberProperty.FindPropertyRelative("Target");
             * var memberNameProperty = _reflectionMemberProperty.FindPropertyRelative("MemberName");
             *
             * EditorGUILayout.PropertyField(targetProperty, _targetContent);
             *
             * if (targetProperty.objectReferenceValue != null)
             * {
             *  GUI.enabled = memberNameProperty.stringValue != "- None -";
             *
             *  memberNameProperty.stringValue = OSCEditorLayout.PropertiesPopup(targetProperty.objectReferenceValue,
             *                                                                   memberNameProperty.stringValue,
             *                                                                   _informer.InformerType,
             *                                                                   _propertyContent);
             *
             *  GUI.enabled = true;
             * }
             */

            GUILayout.EndVertical();

            //SETTINGS
            EditorGUILayout.LabelField(_settingsTitleContent, EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

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

            if (!_informOnChangedProperty.boolValue)
            {
                EditorGUILayout.PropertyField(_informIntervalProperty, _informIntervalContent);

                if (_informIntervalProperty.floatValue < 0)
                {
                    _informIntervalProperty.floatValue = 0;
                }

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

            GUILayout.EndVertical();
        }
        protected override void DrawSettings()
        {
            _defaultColor = GUI.color;

            // TARGET
            EditorGUILayout.LabelField(_targetTitleContent, EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

            OSCEditorLayout.ReflectionMember(_reflectionMemberProperty, _informer.InformerType, OSCReflectionAccess.Read);

            GUILayout.EndVertical();

            //SETTINGS
            EditorGUILayout.LabelField(_settingsTitleContent, EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");

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

            if (!_informOnChangedProperty.boolValue)
            {
                EditorGUILayout.PropertyField(_informIntervalProperty, _informIntervalContent);

                if (_informIntervalProperty.floatValue < 0)
                {
                    _informIntervalProperty.floatValue = 0;
                }

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

            GUILayout.EndVertical();
        }