static void EditModeButton(Rect position, bool enabled, ChiselEditToolBase editMode, GUIStyle style)
        {
            var editModeType = editMode.GetType();

            using (new EditorGUI.DisabledScope(!enabled))
            {
                EditorGUI.BeginChangeCheck();
                var value = Toggle(position, editMode, editModeType, style);
                if (EditorGUI.EndChangeCheck() && value)
                {
                    ToolManager.SetActiveTool(editModeType);
                    ChiselEditorSettings.Save();
                }
            }
        }
 public void ToolNotActivatingBugWorkAround()
 {
     if (lastSelectedTool == null)
     {
         if (Tools.current != Tool.Custom &&
             lastRememberedToolType != null)
         {
             ToolManager.SetActiveTool(lastRememberedToolType);
             lastRememberedToolType = null;
         }
         else
         if (ToolManager.activeToolType == this.GetType())
         {
             OnActivate();
         }
     }
 }
示例#3
0
 public static void ActivateTool()
 {
     ToolManager.SetActiveTool <ChiselUVRotateTool>();
 }
示例#4
0
 public static void ActivateTool()
 {
     ToolManager.SetActiveTool <ChiselMovePivotTool>();
 }
示例#5
0
 public static void ActivateTool()
 {
     ToolManager.SetActiveTool <ChiselPlacementTool>();
 }
 public static void ActivateTool()
 {
     ToolManager.SetActiveTool <ChiselEditGeneratorTool>();
 }
示例#7
0
        // Unity bug workaround
        void OnDelayedSelectionChanged()
        {
            UnityEditor.Selection.selectionChanged -= OnDelayedSelectionChanged;

            ToolManager.SetActiveTool(typeof(ChiselEditGeneratorTool));
        }