Jump to content

Will Unity5 *require* using unity development tool to code a UI?


Recommended Posts

I'm having a hard time getting a straight answer about this from reading Unity's website of docs:

It seems that the new Unity5 docs refer to any and all attempts to write a UI directly in C# code without running the Unity development IDE as being "legacy Unity 4". All attempts to learn what's new with the Unity5 GUI system always refer to using the Unity editor to spec out the GUI, rather than building one from scratch with your own C# code opening a window, drawing widgets into it, and so on.

Up until now I've been able to write mod code by just linking to the UnityEngine dll to get the API methods, and never even using Unity's own dev tool - just using only a normal C# development suite. Is that gone now in Unity5? To use their new GUI system do we *have* to use Unity's editor? I can find no documentation whatsoever on the actual underlying GU API calls to build the GUI from scratch anymore, other than those that are labeled as being "legacy Unity 4" calls.

It is currently possible for people to build all the kOS mod's code from the Github source without any Unity dev environment installed at all - just Visual Studio, SharpDevelop, or whatever C# compiler you like.

Edited by Steven Mading
Link to comment
Share on other sites

If you're talking about doing something like this:


GUILayout.BeginHorizontal(GUILayout.Width(500));
GUILayout.Label("Wind " + MPFunctions.MStoKTS(MPSailRoutines.windForce)+" kts.");
GUILayout.Label("Lat " + MPFunctions.GetLat(FlightGlobals.ActiveVessel,1));
GUILayout.Label("Long " + MPFunctions.GetLong(FlightGlobals.ActiveVessel,1));
GUILayout.Label("Heading " + MPFunctions.GetHeading(MPSailRoutines.TWR1Vessel));
GUILayout.Label("Body " + MPFunctions.GetBody());
GUILayout.EndHorizontal();
GUI.DragWindow();

Dunno if this really answers your question but I'm using Unity 5.1 dll's in my install of C# and the above works fine.

Link to comment
Share on other sites

The "Legacy" UI stuff is still supported, and updated, in 5.x unity versions. They just call it legacy because there's a newer system now.

Well, that's a bit reassuring. The important part of that sentence is that "and updated" part.

The word "Legacy" made it sound as if it was going to be frozen as whatever it was in Unity 4, with none of the Unity 5 changes in it.

Link to comment
Share on other sites

You can code the new UI with pure code. Some mods already do it since the new UI actually came in 4.6. From what I understand we will have some helper call in KSP 1.1 too

And yes, the legacy UI is frozen. They are totally different systems

Link to comment
Share on other sites

You can code the new UI with pure code. Some mods already do it since the new UI actually came in 4.6. From what I understand we will have some helper call in KSP 1.1 too

And yes, the legacy UI is frozen. They are totally different systems

Then where the heck is the documentation for how to code the new UI purely with code? That's what I can't find, and why I am getting worried.

If I click on the links of the Unity website that talk about Unity 5's new gui, they only talk about using the Editor to do it. If I try to click on links about doing it all in C#, they only go to the legacy descriptions.

Edit: I finally found it. I now see topics for the UI under unity 5's "Scripting API" section that previously (a few weeks ago) I swear I could not find at all. If you start from their pages about the new UI and try to find links from THERE to the scripting API, they only provided links to the legacy version. But if you just go right to the scripting UI and start browsing the classes you do eventually find them. They just failed to link to the relevant part from their page on what changed about the GUI between 4 and 5.

Edited by Steven Mading
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...