Skip to content

Instantly share code, notes, and snippets.

@FleshMobProductions
FleshMobProductions / ExampleBehavior.cs
Created April 29, 2022 21:52 — forked from ProGM/ExampleBehavior.cs
A PropertyDrawer to show a popup field with a generic list of string for your Unity3d attribute
public class MyBehavior : MonoBehaviour {
// This will store the string value
[StringInList("Cat", "Dog")] public string Animal;
// This will store the index of the array value
[StringInList("John", "Jack", "Jim")] public int PersonID;
// Showing a list of loaded scenes
[StringInList(typeof(PropertyDrawersHelper), "AllSceneNames")] public string SceneName;
}