Skip to content

Instantly share code, notes, and snippets.

@knowlife4
knowlife4 / SpatialHashGrid.cs
Last active February 9, 2024 11:02
Spatial Hash Grid for the Unity Game Engine.
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class SpatialHashGrid<T> where T : MonoBehaviour
{
public SpatialHashGrid(int xSize, int ySize, int zSize) => CellSize = new int3(xSize, ySize, zSize);
public SpatialHashGrid(int3 cellSize) => CellSize = cellSize;