Page 1 of 1

How to define a drop down in C# script

Posted: 29 Oct 2019, 02:48
by hansanjie
I want to expose a enum perporty in my C# script input, by clicking the drop down,I can change or choose the perporty quickly, but i donot know how to define a drop down input;

also,i donot know how to set a default value outside the C# script, such as setting a integer 10 as default value,not 0;

does anybody knows ,please let me know, thank you! :)

Re: How to define a drop down in C# script

Posted: 29 Oct 2019, 10:18
by stephen
Hey,

you can do both by placing the Script inside a Content Container.

Use an Enumeration Node next to the Script Node and expose the Input property. By double clicking on the square in front of the property you can change its Name and Category on the Container. You can either bind the Enumeration's Output property to an Int Input of the Script or bind the Input property to a String Input of the Script.

When exposing an Integer Input Property of the Script you can again double click the square in front of it in the Property Editor to change its default value.

I know that this is a bit uncomfortable at the time.

Best
Stephen

Re: How to define a drop down in C# script

Posted: 29 Oct 2019, 14:03
by hansanjie
thank you so much ,i got it!