Skip to content

Instantly share code, notes, and snippets.

@mattdevv
mattdevv / EnumArray.cs
Last active January 3, 2025 04:35 — forked from a-gruzdev/EnumArray.cs
Fixed length array indexable by enum. Includes custom PropertyDrawer
using System;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[Serializable]
public class EnumArray<E, T> : ISerializationCallbackReceiver where E : Enum
{
public static readonly int s_Length;
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always