Answers for "unity editor dropdown menu"

C#
0

dropdown in unity inspector

enum myEnum // your custom enumeration {    Item1,     Item2,     Item3 }; var dropDown = myEnum.Item1;  // this public var should appear as a drop down
Posted by: Guest on June-19-2021
0

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

C# Answers by Framework

Browse Popular Code Answers by Language