Skip to content

Name the elements in the array according to the enum in the Unity Inspector

License

Notifications You must be signed in to change notification settings

snoopyuj/OdinEnumArrayTitle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Odin Array Enum Title

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 out BInspector.ArrayElementTitle.

Installation

Simply copy the folder into your Unity project.

Tutorial

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];

Preview

Demo

Please check OdinArrayEnumTitleDemo.cs and Demo scene for the complete tutorial.

About

Name the elements in the array according to the enum in the Unity Inspector

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages