0

Using Unity3Ds built in EditorGUI System I would like to make the work of my gamedesigner easier by creating a custom editor for dialogue systems. I would like to be able to insert Item names into the Editor's EnumPopup. The problem is that my List/Array of Items is generated at runtime so I cant use it as an enum.

Every of my Items also has an assigned ItemID which makes the enum logic a bit easier.

How could I convert Dictionary<int, Item> to an enum which can be then used in ...

EnumPopup(Enum selected, params GUILayoutOption[] options);

1
  • An array/list/dictionary are completely different types of objects to enums - there is no conversion between the two. Your current design is incompatible with what you are trying to do. Commented Jan 11, 2017 at 5:53

1 Answer 1

2

Why don't you use EditorGUILayout.Popup? You can list your dictionary's values as a string and pass them to the popup as options.

Sign up to request clarification or add additional context in comments.

2 Comments

Well it does not answer the initial question, but it is a solution for what the asker is trying to achieve. It was helpful to me
Well it surely is a solution to go around the enum part. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.