コード例 #1
0
 void OnSceneGUI(SceneView sceneView)
 {
     if (showGrid)
     {
         GridDrawer.Draw(level.Grid, gridSize);
         sceneView.Repaint();
     }
 }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
ファイル: GridInspector.cs プロジェクト: hesmeron/Fornlinev3
    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();
        }
    }