static void OnDisableTool(IBrushTool tool)
 {
     if (tool != null)
     {
         tool.OnDisableTool();
     }
 }
Пример #2
0
        public static bool HandleSceneKeyUp(IBrushTool tool, bool checkForTextEditing = true)
        {
            if (EditorGUIUtility.editingTextField && checkForTextEditing)
            {
                return(false);
            }

            if (Keys.MakeSelectedPassThroughKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                OperationsUtility.SetPassThroughOnSelected(); return(true);
            }
            if (Keys.MakeSelectedAdditiveKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                OperationsUtility.ModifyOperationsOnSelected(CSGOperationType.Additive); return(true);
            }
            if (Keys.MakeSelectedSubtractiveKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                OperationsUtility.ModifyOperationsOnSelected(CSGOperationType.Subtractive); return(true);
            }
            if (Keys.MakeSelectedIntersectingKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                OperationsUtility.ModifyOperationsOnSelected(CSGOperationType.Intersecting); return(true);
            }

            if (Keys.ToggleSelectedObjectVisibilityKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                SelectionUtility.ToggleSelectedObjectVisibility(); return(true);
            }
            if (Keys.QuickHideSelectedObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                SelectionUtility.HideSelectedObjects(); return(true);
            }
            if (Keys.QuickHideUnselectedObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                SelectionUtility.HideUnselectedObjects(); return(true);
            }
            if (Keys.UnHideAllObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                SelectionUtility.UnHideAll(); return(true);
            }
            if (Keys.CancelActionKey.IsKeyPressed())
            {
                SelectionUtility.DeselectAll(); return(true);
            }

            if (Keys.HalfGridSizeKey.IsKeyPressed())
            {
                GridUtility.HalfGridSize(); return(true);
            }
            if (Keys.DoubleGridSizeKey.IsKeyPressed())
            {
                GridUtility.DoubleGridSize(); return(true);
            }
            if (Keys.ToggleShowGridKey.IsKeyPressed())
            {
                GridUtility.ToggleShowGrid(); return(true);
            }
            if (Keys.ToggleSnappingKey.IsKeyPressed())
            {
                GridUtility.ToggleSnapToGrid(); return(true);
            }
            return(false);
        }
Пример #3
0
 public Task UseBrushAsync(IBrushTool brush)
 {
     return(Task.Run(() => UseBrush(brush)));
 }
Пример #4
0
        public static bool HandleSceneKeyDown(IBrushTool tool, bool checkForTextEditing = true)
        {
            if (EditorGUIUtility.editingTextField && checkForTextEditing)
            {
                return(false);
            }

            if (Keys.MakeSelectedPassThroughKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.MakeSelectedAdditiveKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.MakeSelectedSubtractiveKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.MakeSelectedIntersectingKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }

            if (Keys.ToggleSelectedObjectVisibilityKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.QuickHideSelectedObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.QuickHideUnselectedObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.UnHideAllObjectsKey.IsKeyPressed() && tool.UsesUnitySelection)
            {
                return(true);
            }
            if (Keys.CancelActionKey.IsKeyPressed())
            {
                return(true);
            }

            if (Keys.HalfGridSizeKey.IsKeyPressed())
            {
                return(true);
            }
            if (Keys.DoubleGridSizeKey.IsKeyPressed())
            {
                return(true);
            }
            if (Keys.ToggleShowGridKey.IsKeyPressed())
            {
                return(true);
            }
            if (Keys.ToggleSnappingKey.IsKeyPressed())
            {
                return(true);
            }
            return(false);
        }
Пример #5
0
 public void UseBrush(IBrushTool brush)
 {
     Tool = brush;
     Mode = StylusMode.Brush;
 }