Esempio n. 1
0
        public void SetEditorTool(EditorTool tool)
        {
            foreach (LevelToolWindow ltw in GetAllOpenLevelToolWindows())
            {
                EditorTool newtool = (EditorTool)tool.Clone();
                newtool.Editor         = ltw.LevelEditor;
                newtool.FinishCallback = new CallbackMethod(FinishTool);

                //Deactivate current tool
                ltw.LevelEditor.SelectedTool.Deactivate();

                //Set new tool
                ltw.LevelEditor.SelectedTool = newtool;

                //Activate new tool
                newtool.Activate();
            }
        }