コード例 #1
0
 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;
 }
コード例 #2
0
            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);
                }
            }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 void ClearStoredEditModeState()
 {
     storedSelection = null;
     storedEditMode  = null;
 }
コード例 #5
0
 void StoreEditModeState()
 {
     storedSelection        = Selection.objects;
     storedEditMode         = ChiselEditModeManager.EditMode;
     Selection.activeObject = null;
 }
コード例 #6
0
 public ChiselEditModeItem(IChiselToolMode value, Type type)
 {
     this.instance = value;
     this.type     = type;
 }
コード例 #7
0
 private static void OnEditModeChanged(IChiselToolMode prevEditMode, IChiselToolMode newEditMode)
 {
     ChiselOutlineRenderer.Instance.OnEditModeChanged(prevEditMode, newEditMode);
 }