• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Feb 19, 2015 at 02:20 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by JPB18 · Dec 25, 2014 at 12:23 PM · inputenum

How to use Unity Enums in a WinForms project

Hey all!

So I'm currently making a custom Input Manager for my game. And to make my life easier, I'd like to make a WinForms application in order to generate the first JSON, from which the game will then load its default keybindings...

Now I know that the UnityEngine.dll is just a wrapper for engine functionality written in native code, but is it possible to add, for example, the KeyCode enum to a WinForms project?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EvilTak · Dec 25, 2014 at 01:13 PM 0
Share

You should try it and see... That is the best way xD

avatar image JPB18 · Dec 26, 2014 at 06:14 PM 0
Share

Unfortunatelly, it isn't... However, I had an idea to extract the enum, and the correspondent integer for each entry, might work that way! :D

avatar image JPB18 · Feb 19, 2015 at 01:14 AM 0
Share

Too bad I can't make it an answer, cause that was it! xD

avatar image meat5000 ♦ · Feb 19, 2015 at 01:36 AM 1
Share

Done.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by Landern · Dec 26, 2014 at 07:12 PM

@JPB18 is on the right path, using the enum type and value would be the best way to pass the information back and forth and have it valid in both cases. Optionally, but more dirty would be to copy the namespace and full class and implement it in your winform config dialog. I would go with the first way though since it will translate with Enum.Parse().

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to use number keys as a throttle? 0 Answers

Input.GetKey() with multiple enum values (C#) 4 Answers

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

Possible to add input controls to enum? 2 Answers

Gamepad input enum eType not working 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges