-
Notifications
You must be signed in to change notification settings - Fork 84
Setup Empty Form
C. K edited this page Aug 1, 2020
·
1 revision
This is an expanded guide on the steps to get a basic form up and running.
Import the Unity-WinForms plugin and install it.
- Download Unity-WinForms.unitypackage.
- Import to your Unity project by opening the file.
-
Assets\Unity-WinForms
should now exist in your project.
- Create an empty GameObject, I called it WinForm.
- Attach the UnityWinForms script to the WinForm GameObject. Path to UnityWinForms script
\Assets\Unity-WinForms\Unity\UnityWinForms.cs
- On the WinForm GameObject, expand Resources/Fonts, select a size and add Arial to element 0. This will remove font errors.
- Create a new C# script
WinForm.cs
.
using UnityEngine;
using System.Windows.Forms;
public class WinForm : MonoBehaviour
{
void Start()
{
var form = new Form();
form.Show();
// Or show a message.
//// MessageBox.Show("Hello World.");
}
}
- Attach
WinForm.cs
to WinForm GameObject.
All items in the form has to be added by code. By running your Unity application an empty form should now show up.