internal void OnEditModeChanged(IChiselToolMode prevEditMode, IChiselToolMode newEditMode) { // Defer since we could potentially get several events before we actually render // also, not everything might be set up correctly just yet. updateBrushSelection = true; updateSurfaceSelection = true; }
public ChiselEditModeItem(IChiselToolMode value, Type type) { this.instance = value; this.type = type; var icon = ChiselEditorResources.LoadIconImage(instance.ToolName, false); if (icon != null) { this.content = new GUIContent(icon, instance.ToolName); } else { this.content = new GUIContent(instance.ToolName); } }
public static void OnSceneGUI(SceneView sceneView, Rect dragArea) { var editModes = ChiselEditModeManager.editModes; var generatorModes = ChiselEditModeManager.generatorModes; if (editModeWindow == null) { var minWidth = 80; var minHeight = 40; var rect = new Rect(0, 0, 92, 24 + ((editModes.Length + generatorModes.Length) * (kSingleLineHeight + kSingleSpacing)) + kGeneratorSeparator + kExtraBottomSpacing); editModeWindow = new GUIResizableWindow("Tools", rect, minWidth, minHeight, OnWindowGUI); } editModeWindow.Show(dragArea); IChiselToolMode currentToolMode = ChiselEditModeManager.EditMode; if (currentToolMode != prevToolMode) { if (prevToolMode != null) { prevToolMode.OnDisable(); } // Set defaults ChiselOutlineRenderer.VisualizationMode = VisualizationMode.Outline; Tools.hidden = false; if (currentToolMode != null) { currentToolMode.OnEnable(); } } prevToolMode = currentToolMode; if (currentToolMode != null) { dragArea.x = 0; dragArea.y = 0; currentToolMode.OnSceneGUI(sceneView, dragArea); } }
void ClearStoredEditModeState() { storedSelection = null; storedEditMode = null; }
void StoreEditModeState() { storedSelection = Selection.objects; storedEditMode = ChiselEditModeManager.EditMode; Selection.activeObject = null; }
public ChiselEditModeItem(IChiselToolMode value, Type type) { this.instance = value; this.type = type; }
private static void OnEditModeChanged(IChiselToolMode prevEditMode, IChiselToolMode newEditMode) { ChiselOutlineRenderer.Instance.OnEditModeChanged(prevEditMode, newEditMode); }