public static bool DrawButton(Coord coord, MatrixBuilding matrix)
        {
            CoolEditor.SetHandlesMatrix(matrix.transform.localToWorldMatrix);

            bool clicked = false;
            bool exists  = matrix.pieces.ContainsKey(coord) && matrix.pieces[coord];

            CoolEditor.SetHandlesColor(exists? Color.red: Color.green);

            float   size = FloorTile.tileSize * 0.2f;
            Vector3 pos  = coord.ToWorld() + new Vector3(-1, 0, 1) * FloorTile.tileSize * 0.5f;

            if (Handles.Button(pos, Quaternion.Euler(90, 0, 0), size, size,
                               Handles.CircleHandleCap))
            {
                if (exists)
                {
                    matrix.Remove(coord);
                }
                else
                {
                    matrix.Add(coord);
                }
                matrix.Blend(coord);
                clicked = true;
            }

            CoolEditor.RestoreHandlesColor();
            CoolEditor.RestoreHandlesMatrix();
            return(clicked);
        }
 public void DrawGizmos(MatrixBuilding building)
 {
     foreach (KeyValuePair <Coord, BuildingCell> piece in building.pieces)
     {
         if (!piece.Value)
         {
             continue;
         }
         BuildingCellEditor.DrawGizmos(piece.Value);
         if (BuildingCellEditor.hasModifiedCollection)
         {
             return;
         }
     }
 }
 public void DrawInspectorGUI(MatrixBuilding building)
 {
 }