コード例 #1
0
        void OnGUI()
        {
            using (EditorGUILayout.ScrollViewScope scrollScope = new EditorGUILayout.ScrollViewScope(dictionaryScrollPosition, GUIStyle.none, GUI.skin.verticalScrollbar))
            {
                dictionaryScrollPosition = scrollScope.scrollPosition;

                using (new EditorGUILayout.VerticalScope())
                {
                    using (new EditorGUILayout.VerticalScope())
                    {
                        serializedObject.Update();
                        EditorGUILayout.PropertyField(settingsProp);
                        serializedObject.ApplyModifiedProperties();

                        if (settings == null)
                        {
                            LogSettings newSettings = LogLevelsGUI.DrawCreateNewButton();
                            if (newSettings != null)
                            {
                                settingsProp.objectReferenceValue = newSettings;
                                serializedObject.ApplyModifiedProperties();
                            }
                        }
                        else
                        {
                            LogLevelsGUI.DrawLogFactoryDictionary(settings);
                        }
                    }
                }
            }
        }
コード例 #2
0
        void OnGUI()
        {
            EditorGUILayout.BeginVertical();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField(new GUIContent("Mirror Log Levels"), EditorStyles.boldLabel);
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);

            serializedObject.Update();
            EditorGUILayout.PropertyField(settingsProp);
            serializedObject.ApplyModifiedProperties();

            if (settings == null)
            {
                LogSettings newSettings = LogLevelsGUI.DrawCreateNewButton();
                if (newSettings != null)
                {
                    settingsProp.objectReferenceValue = newSettings;
                    serializedObject.ApplyModifiedProperties();
                }
            }
            else
            {
                LogLevelsGUI.DrawLogFactoryDictionary(settings);
            }

            EditorGUILayout.EndVertical();
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            NetworkLogSettings target = this.target as NetworkLogSettings;

            if (target.settings == null)
            {
                LogSettings newSettings = LogLevelsGUI.DrawCreateNewButton();
                if (newSettings != null)
                {
                    SerializedProperty settingsProp = serializedObject.FindProperty("settings");
                    settingsProp.objectReferenceValue = newSettings;
                    serializedObject.ApplyModifiedProperties();
                }
            }
            else
            {
                LogLevelsGUI.DrawLogFactoryDictionary(target.settings);
            }
        }
コード例 #4
0
        public override void OnInspectorGUI()
        {
            CurrentScriptField();

            LogLevelsGUI.DrawLogFactoryDictionary(target as LogSettings);
        }