Skip to content

Instantly share code, notes, and snippets.

View FrogsInSpace's full-sized avatar
🏠
Working from home

Josef Wienerroither FrogsInSpace

🏠
Working from home
View GitHub Profile
@FrogsInSpace
FrogsInSpace / HexGridLayout.cs
Created March 5, 2022 10:58 — forked from PopupAsylumUK/HexGridLayout.cs
A Layout group for arranging children in a hexagon grid, and a Hexagon graphic
using UnityEngine;
using UnityEngine.UI;
public class HexGridLayout : LayoutGroup {
const float SQUARE_ROOT_OF_3 = 1.73205f;
public enum Axis { Horizontal = 0, Vertical = 1 }
public enum Constraint { Flexible = 0, FixedColumnCount = 1, FixedRowCount = 2 }