How to define a drop down in C# script

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
hansanjie
Posts: 8
Joined: 27 Mar 2018, 04:33

How to define a drop down in C# script

Post by hansanjie » 29 Oct 2019, 02:48

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! :)

stephen
Posts: 73
Joined: 06 Aug 2013, 14:11

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

Post by stephen » 29 Oct 2019, 10:18

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

hansanjie
Posts: 8
Joined: 27 Mar 2018, 04:33

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

Post by hansanjie » 29 Oct 2019, 14:03

thank you so much ,i got it!

Post Reply