Name the elements in the array according to the enum.
Author: bwaynesu
Created: August 13, 2022
Tags: C#, Unity3D
Note: This plugin needs to be used together with the
Odin Inspector
plugin to work.
If you want to use similar features in native Unity, please check outBInspector.ArrayElementTitle
.
Simply copy the folder into your Unity project.
using BTools.BInspector;
// 1. Define an enum to be used as the display name for the array elements.
public enum DirectionType : byte
{
North = 0,
South,
East,
West,
}
// 2. Designate the array to display the enum title in the Inspector
[OdinArrayEnumTitle(typeof(DirectionType))]
public Vector3[] vectorArray = new Vector3[0];
Please check OdinArrayEnumTitleDemo.cs and Demo scene for the complete tutorial.