示例#1
0
        static ToolManager()
        {
            MoveTool   = new MoveTool();
            SelectTool = new SelectTool();
            ScaleTool  = new ScaleTool();
            RotateTool = new RotateTool();

            SelectionService.Service.SelectionChanged.Event += () =>
            {
                ContextActionService.SetState("selectionEmpty", SelectionService.SelectionCount == 0);
            };

            ContextActionService.Register("tools.selectTool", () => SelectTool.IsEquipped = true);
            ContextActionService.Register("tools.moveTool", () => MoveTool.IsEquipped     = true);
            ContextActionService.Register("tools.scaleTool", () => ScaleTool.IsEquipped   = true);
            ContextActionService.Register("tools.rotateTool", () => RotateTool.IsEquipped = true);
            ContextActionService.Register("pickerInsideModels", PickerInsideModels);
            ContextActionService.Register("groupSelection", GroupSelection);
            ContextActionService.Register("ungroupSelection", UngroupSelection);
        }
示例#2
0
 protected override void OnDeactivate(bool close)
 {
     ContextActionService.SetState("scriptEditorFocus", false);
 }
示例#3
0
 protected override void OnActivate()
 {
     ContextActionService.SetState("scriptEditorFocus", true);
 }