public override void OnInspectorGUI()
        {
            if (!target)
            {
                return;
            }
            serializedObject.Update();
            if (PreviewTextureManager.Update())
            {
                Repaint();
            }

            base.OnInspectorGUI();
            try
            {
                EditorGUI.BeginChangeCheck();
                {
                    GUILayout.BeginHorizontal();
                    ShowOperationChoicesInternal(operationProp);
                    if (typeof(T) != typeof(ChiselBrush))
                    {
                        ConvertIntoBrushesButton(serializedObject);
                    }
                    GUILayout.EndHorizontal();

                    OnInspector();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                }
            }
            catch (ExitGUIException) { }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            if (!target)
            {
                return;
            }
            Profiler.BeginSample("OnInspectorGUI");
            serializedObject.Update();

            base.OnInspectorGUI();
            try
            {
                EditorGUI.BeginChangeCheck();
                {
                    ShowInspectorHeader(operationProp);
                    OnInspector();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                }
            }
            catch (ExitGUIException) { }
            catch (Exception ex) { Debug.LogException(ex); }

            if (PreviewTextureManager.Update())
            {
                Repaint();
            }
            Profiler.EndSample();
        }
 void OnDisable()
 {
     UpdateSelection();
     UnityEditor.Undo.undoRedoPerformed -= OnUndoRedoPerformed;
     PreviewTextureManager.CleanUp();
     Reset();
 }
Пример #4
0
 void OnDisable()
 {
     UpdateSelection();
     UnityEditor.Undo.undoRedoPerformed -= OnUndoRedoPerformed;
     PreviewTextureManager.CleanUp();
     Reset();
     ChiselEditGeneratorTool.OnEditSettingsGUI = null;
     ChiselEditGeneratorTool.CurrentEditorName = null;
     Tools.hidden = false;
 }
Пример #5
0
        void OnDisable()
        {
            UpdateSelection();
            UnityEditor.Undo.undoRedoPerformed -= OnUndoRedoPerformed;
            PreviewTextureManager.CleanUp();
            Reset();
            Tools.hidden = false;

            ToolManager.activeToolChanged -= OnToolModeChanged;
            ShutdownInspector();
        }
Пример #6
0
        public bool OnPreviewGUI(Rect region, GUIStyle background, Material material)
        {
            var newPreviewDir = Drag2D(previewDir, region);

            if (newPreviewDir != previewDir)
            {
                previewDir = newPreviewDir;
                PreviewTextureManager.Clear();
            }

            var texture = PreviewTextureManager.GetPreviewTexture(region, previewDir, material);

            if (!texture)
            {
                return(false);
            }
            GUI.DrawTexture(region, texture, ScaleMode.StretchToFill, false);
            return(true);
        }
Пример #7
0
        public static bool OnPreviewGUI(Rect region, GUIStyle background, Material material)
        {
            var newPreviewDir = Drag2D(previewDir, region);

            if (newPreviewDir != previewDir)
            {
                previewDir = newPreviewDir;
                PreviewTextureManager.Clear();
            }

            var texture = PreviewTextureManager.GetPreviewTexture(region, previewDir, material);

            if (!texture)
            {
                if (Event.current.type == EventType.Repaint)
                {
                    background.Draw(region, false, false, false, false);
                }
                return(false);
            }
            GUI.DrawTexture(region, texture, ScaleMode.StretchToFill, false);
            return(true);
        }
 void OnDisable()
 {
     PreviewTextureManager.CleanUp(); Reset();
 }