Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | cheo |
This code works nicely and will let me choose a value in the Editor’s class section property from a drop-down menu:
export(String,"Item1","Item2","Item3") var item_type
Eventually I want to replace “Item”, “Item2”, etc with a variable because I’m importing the data from a dictionary in a JSON file:
var itemjson = item_data.keys()
that will return a TYPE_ARRAY:
[Item1, Item2, Item3]
I’ve tried several combinations, but none of them work:
export(String,itemsjson) var item_type
export(Array,String) var item_type = itemjson
Any insight on how to accomplish this?