Пример #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //DrawHeader();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/

            Expanded = _mainPanelRenderer.RenderStart(GuiContentCache.Instance.FontMapperEditor, Expanded);

            if (Expanded)
            {
                DrawDefaultInspector();
                _mainPanelRenderer.RenderEnd();
            }

            /**
             * The order of applying the propertis MUST be as follows:
             * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
             * 2. Applying changes made in play mode
             * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
             * */
            serializedObject.ApplyModifiedProperties();
            //PersistenceManager.Instance.CallApplyChanges();
            //PersistenceManager.Instance.ApplyChanges();

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/
            Expanded = _mainPanelRenderer.RenderStart(EditorPanelTitle, Expanded);

            if (Expanded)
            {
                RenderMainOptions();
                _mainPanelRenderer.RenderEnd();
            }
            else
            {
                BlankCallback();
            }

            RenderExtendedOptions();

            /**
             * The order of applying the propertis MUST be as follows:
             * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
             * 2. Applying changes made in play mode
             * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
             * */
            serializedObject.ApplyModifiedProperties();
            //PersistenceManager.Instance.CallApplyChanges();
            //PersistenceManager.Instance.ApplyChanges();

            if (AutoConfigure)
            {
                if (GUI.changed)
                {
#if DEBUG
                    if (DebugMode)
                    {
                        Debug.Log("GUI.changed: " + GUI.changed + " target: " + target);
                    }
#endif
                    Apply();
                }
            }

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //DrawHeader();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/

            Expanded = _mainPanelRenderer.RenderStart(GuiContentCache.Instance.AudioPlayerMapperEditor, Expanded);

            if (Expanded)
            {
                Default.boolValue = EditorGUILayout.Toggle("Default", Default.boolValue);

                Id.stringValue = EditorGUILayout.TextField("Id", Id.stringValue);

                PlayAtMainCamera.boolValue = EditorGUILayout.Toggle("PlayAtMainCamera", PlayAtMainCamera.boolValue);

                SoundEnabled.boolValue = EditorGUILayout.Toggle("SoundEnabled", SoundEnabled.boolValue);

                Volume.floatValue = EditorGUILayout.Slider("Volume", Volume.floatValue, 0, 1);
                ProgressBar(Volume.floatValue, "Volume");

                Pitch.floatValue = EditorGUILayout.Slider("Pitch", Pitch.floatValue, 0, 10);

                PitchRandomness.floatValue = EditorGUILayout.Slider("PitchRandomness", PitchRandomness.floatValue, 0, 1);

                /**
                 * The order of applying the propertis MUST be as follows:
                 * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
                 * 2. Applying changes made in play mode
                 * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
                 * */
                serializedObject.ApplyModifiedProperties();

                _mainPanelRenderer.RenderEnd();
            }

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }