void OnSceneGUI(SceneView sceneView) { if (showGrid) { GridDrawer.Draw(level.Grid, gridSize); sceneView.Repaint(); } }
public void DoLayout(Rect rect) { _gridDrawer.CellSize = (rect.height / (BaseGridCellSize) * (2f * DrawingContext.Current.Zoom)); _gridDrawer.Draw(rect, -DrawingContext.Current.Scroll, rect.center); DrawingContext.Current.Draw(); foreach (var action in _actions) { if (action.TryExecute()) { break; } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); bool generateGrid = GUILayout.Button("Generate", GUILayout.Height(2 * EditorGUIUtility.singleLineHeight)); bool clearGrid = GUILayout.Button("Clear", GUILayout.Height(2 * EditorGUIUtility.singleLineHeight)); if (generateGrid) { _myTarget.Draw(); } if (clearGrid) { _myTarget.Clear(); } }