private void Brush(object sender, RoutedEventArgs e)
 {
     try
     {
         LevelEditorTool Tool = LevelEditorTool.Brush;
         Controller.Model.Tool = Tool;
     }
     catch { }
 }
 private void Collision(object sender, RoutedEventArgs e)
 {
     try
     {
         LevelEditorTool Tool = LevelEditorTool.Collision;
         Controller.Model.Tool = Tool;
     }
     catch { }
 }
Beispiel #3
0
 public void HandleHoverDraw(LevelEditorTool editorTool, int toolIndex, EditorWindow window)
 {
     var rect = GUILayoutUtility.GetLastRect();
     var pos = Event.current.mousePosition;
     if(Event.current.modifiers == EventModifiers.Control && rect.Contains(pos))
     {
         OnMouseEventDrawSelectedToolTexture(null, -1);
         window.Repaint();
     }
     else if (Event.current.modifiers == EventModifiers.Shift && rect.Contains(pos))
     {
         OnMouseEventDrawSelectedToolTexture(editorTool.gridSprite, toolIndex);
         window.Repaint();
     }
 }
Beispiel #4
0
 public void DrawCell(LevelEditorTool editorTool, int toolIndex, EditorWindow window)
 {
     EditorUIUtility.DrawButton(texture, () => OnMouseEventDrawSelectedToolTexture(editorTool.gridSprite, toolIndex), GUILayout.Width(25), GUILayout.Height(25));
     HandleHoverDraw(editorTool, toolIndex, window);
 }
 public void SelectTool(int index)
 {
     currentSelectedTool      = configuration.toolConfiguration.tools[index];
     currentSelectedToolIndex = index;
 }