Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Created December 11, 2019 12:47
Show Gist options
  • Save mvidaldp/e96d24f594a17359acb482874828df7e to your computer and use it in GitHub Desktop.
Save mvidaldp/e96d24f594a17359acb482874828df7e to your computer and use it in GitHub Desktop.
Add a dropdown menu option on the unity inspector from a script
using UnityEngine;
public class DropDownMenuOnScript : MonoBehaviour
{
public enum Option { one, two, three, four, five }; // declare your dropdown list enumerator class with the options you want
public Option option = Option.one; // instantiate your enumerator (it works both with and without initialization)
...
// your methods
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment