Example #1
0
        public bool GetCommand(SketchCommands rCommand)
        {
            // Here you can limit the given command to a specific scope, e.g. only allowing it on the Wand
            // or Brush, but the the controller info is responsible for how that command is mapped to the
            // hardware.

            KeyboardShortcut?shortcut   = MapCommandToKeyboard(rCommand);
            bool             isDemoMode = DemoManager.m_Instance.DemoModeEnabled;

            switch (rCommand)
            {
            case SketchCommands.Activate:
                return(Brush.GetCommand(rCommand) || (!isDemoMode && GetMouseButton(0)));

            case SketchCommands.AltActivate:
                return(GetMouseButton(1) || Wand.GetCommand(rCommand));

            case SketchCommands.LockToHead:
                return(GetKeyboardShortcut(shortcut.Value));

            case SketchCommands.PivotRotation:
                return(GetKeyboardShortcut(shortcut.Value));

            case SketchCommands.WandRotation:
                return(Wand.GetCommand(rCommand));

            case SketchCommands.LockToController:
                return(Wand.GetCommand(rCommand) || Brush.GetCommand(rCommand));

            case SketchCommands.Scale:
                return(GetKeyboardShortcut(shortcut.Value) || Brush.GetCommand(rCommand));

            case SketchCommands.Sensitivity:
                return(Mathf.Abs(Input.GetAxis("Mouse ScrollWheel")) > m_InputThreshold);

            case SketchCommands.Panic:
                return(GetMouseButton(1) || Wand.GetCommand(rCommand));

            case SketchCommands.MultiCamSelection:
                return(Brush.GetCommand(rCommand));

            case SketchCommands.ShowPinCushion:
                return(Brush.GetCommand(rCommand));

            case SketchCommands.DuplicateSelection:
                return(Brush.GetCommand(rCommand));

            case SketchCommands.Undo:
            case SketchCommands.Redo:
                return(Wand.GetCommand(rCommand));

            case SketchCommands.Fly:
                return(Brush.GetCommand(rCommand));
            }


            return(false);
        }