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); } }
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(); }
void OnDisable() { UpdateSelection(); UnityEditor.Undo.undoRedoPerformed -= OnUndoRedoPerformed; PreviewTextureManager.CleanUp(); Reset(); ChiselEditGeneratorTool.OnEditSettingsGUI = null; ChiselEditGeneratorTool.CurrentEditorName = null; Tools.hidden = false; }
void OnDisable() { UpdateSelection(); UnityEditor.Undo.undoRedoPerformed -= OnUndoRedoPerformed; PreviewTextureManager.CleanUp(); Reset(); Tools.hidden = false; ToolManager.activeToolChanged -= OnToolModeChanged; ShutdownInspector(); }
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); }
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(); }