Skip to content

Instantly share code, notes, and snippets.

@onewinter
onewinter / Hex.cs
Last active May 31, 2023 09:17 — forked from inca/Hex.cs
[Unity] Simple Hex Grid System
// https://gist.github.com/inca/0b3d194b755e2efd9d7d8e3665e6cfbb
// math from https://www.redblobgames.com/grids/hexagons/
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public static class HexVectorExtensions {
public static Vector2 WorldToPlanar(this Vector3 world) {