x


Using a windows form in Unity

Hi guys,

In my project, I am trying to have a windows form with a button. and everytime the user clicks the button, a gameobject must do a transform.Rotate or any transform for that instance.

I am able to get the windows form displaying in unity but only when I close the form does the control go back to gameobject. I am unable to to run the form and have control of the object concurrently. I would like to know if it is actually possible to do such a thing.

Also, I have this USB application, which I like to run in unity. This USB application communicates to my program via a form. I would like to know if it is possible to have such an USB application communicate to a Game Object in unity?

Thanks in advance!
Any help would be much appreciated.
-Deepak.

more ▼

asked Jun 02 '10 at 09:41 AM

deepak gravatar image

deepak
4 2 2 2

(comments are locked)
10|3000 characters needed characters left

2 answers: sort newest

I know this is kinda old but i just now saw it cause im just now using this site but anyways you can get a form up in unity using GTK in mono, just import the .dlls that you need into your project then create a form using the GTK, you can even use the visual editor in MonoDev. but combine the two .cs files that it makes for your window into one file then all you have to do is anywhere you want to start the form add this

    Gtk.Application.Init();
    MainWindow chatWindow = new MainWindow();
    chatWindow.Show();
    Gtk.Application.Run();

and then so it will close with the game add this into the function OnApplicationQuit()

    Gtk.Application.Quit();
more ▼

answered Mar 09 '12 at 07:43 AM

shredder2500 gravatar image

shredder2500
31 2

(comments are locked)
10|3000 characters needed characters left

WindowsForms don't work in Unity. Instead we provide a very tightly integrated way for you to extend the unity editor. See Editor Windows in the documentation. For runtime, you can use the same api to get your runtime GUI up and running, GUILayout.* and friends.

more ▼

answered Jun 02 '10 at 05:42 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8k 19 43 85

I know this is old but i also have to say this is somewhat wrong, use GTK and import the GTK dlls that you need and you can get a form up, i posted an answer on how to do this but it has to get accepted.

Mar 09 '12 at 02:52 AM shredder2500
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3742
x261
x22
x6

asked: Jun 02 '10 at 09:41 AM

Seen: 2954 times

Last Updated: Mar 09 '12 at 07:43 AM