Answers for "unity editor dropdown"

C#
-1

unity editor dropdown

//there are two main ways of doing this.
//1. Enumerators
enum Level {Low, Medium, High}
public Level myLevel; //this variable will appear as a drop down
//this method does only work for enum values so if you want strings you'll
//have to use method 2.
//2. Dropdown list. This one requires you to add an asset from the unity store.
//Link: https://assetstore.unity.com/packages/tools/utilities/dropdown-attribute-180951
public List<string> NameList;
[Dropdown("NameList")]//input the path of the list
public string MyName;
Posted by: Guest on June-22-2021

Code answers related to "unity editor dropdown"

C# Answers by Framework

Browse Popular Code Answers by Language