Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Extending UI System 5.2

Discussion in '5.2 Beta' started by Andreas Hesel, Jul 27, 2015.

  1. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Hi

    I'm currently working on a 5.0 project where I have modified the UI System dll to create custom behaviour. Among other things I've added a DataGrid UI control, which is now a large part of most of the scenes involved in the project.

    The UI System source was downloaded from the Mercurial repository:
    https://bitbucket.org/Unity-Technologies/ui/commits/all

    Upgrading to 5.2 is currently not possible since the 5.1 UI Source is not available via the Mercurial repository. If I upgrade the project, I'm missing all my custom changes in the UI System dll - if I recompile the dll, I'm missing all the new features of 5.2.

    Is there a solution to this? Can I get the 5.2 UI Source somewhere, or am I bound to wait for an actual release of the 5.2?

    (I'm okay with not having bug fixes between each minor version released during the Beta, but in the case of 5.2, the Dropdown component has been added, which is something I would like to try/test.)


    /Andreas
     
    KaptajnVom likes this.
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    Hi Andreas.

    We'll ship the 5.2 source for the UI when we release 5.2 final. It will be available.
     
  3. KaptajnVom

    KaptajnVom

    Joined:
    Jun 11, 2014
    Posts:
    2
    Hi Tim,

    The project Andreas is working on also use WebRequest, which currently only is available in 5.2, but since we can't build UI, we end up in a catch-22 situation.

    According to http://unity3d.com/unity/roadmap it seems that we have to wait until mid-September which is aggravating, but I guess that it's just something we have to work around.

    Best Regards,
    Thomas Hagen
     
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    iivo_k and KaptajnVom like this.
  5. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Awesome! Thank you very much Tim.
    I'll give it a whack and see what happens.
     
  6. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,051
    Thanks for that Tim. Should prove useful since i've just started to dig into UI System source myself, so it will be nice to get ahead of the curve a bit and see what is changing in 5.2.

    However i'm having some problems/confusion in general with regards to using the source and building the necessary files. I have no problem building the dll's from the Unity 5.1 version, but I noticed there are other files in Unity install (GUISYstem folder) like xml and mdb that have no explanation ( and I've limited experience building dll's). I'm also thinking the bitbucket readme is a bit outdated since it claims there should be a version folder within GUISystem folder and there is none?

    If you have a moment perhaps you could or someone else familar with Unity UI Source could give some answers or guidance to my post here 'understanding-the-requirements-to-build-and-replace-unity-ui-dlls'. Maybe even consider updating the bitbucket readme to help explain these files and how to build them if they are required.

    Thanks
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    I think what might have happened is a build related person changed how the dll loading worked and didn't tell me ;) I'll investigate and update the readme :)
     
  8. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    I have investigated:

    the mdb is the 'debug data' associated with the dll, not needed but can help. If you build with visual studio this will be a pdd file instead.

    Correct. I have updated the readme.
     
    Noisecrime likes this.
  9. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Got the 5.2.0b5 UI code to compile together with my UI changes. Wasn't really all that much I had to change once I got the new source from you.

    Noted that the comment in all the csproj (UnityEngine.UI, UnityEditor.UI and UnityEngine.UI-Editor) files needs to be updated, since it refers a 4.6.0 Version folder (same as the readme file)
    <!--<Copy SourceFiles="$(TargetDir)$(TargetName).dll" DestinationFiles="C:\Program Files (x86)\Unity\Editor\Data\UnityExtensions\Unity\GUISystem\4.6.0\$(TargetName).dll"/>-->

    Anyway, everything compiles, but once I start up Unity 5.2.0b4 I get swamped with weird exceptions, such as:
    "MissingMethodException: Method not found: 'UnityEngine.Camera.get_pixelWidth'."
    and
    "MissingMethodException: Method not found: 'UnityEngine.Input.get_mouseScrollDelta'."

    Both of these functions exists in the UnityEngine dll (both in Beta5, Beta4 and previous), so I'm a bit at a loss what the problem could be. Got any hints or suggestions?
     
  10. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Since all errors I'm getting are only related to the UI, I assume it is caused by the UnityEngine and UnityEditor dll files located in the lib folder of your source repository - I'm guessing they are 5.2.0b5.

    Once I compile the UI source and replace the files in the installed Unity version (5.2.0b4), the new UI dll cannot reference the needed functions, since the UnityEngine.dll is a different version. This sounds plausible to me, but I'm not really that much at home with dll's - and I doesn't give me a solution (besides replacing all the "old" dlls in the Unity install folder with the "new" ones from the 5.2.0b5 UI repository. And I don't really know where that will land me).
     
  11. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Aaand, just to keep talking to myself; replacing all the UnityEngine.dll wont really work since most of them are located in the "variations" folder, which, I guess from the naming, is compile to a specific native platform.

    Meh.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Build against the one in Editor\Data\Managed.
     
  13. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    Thanks for the reply. That path is not getting me anywhere. Cannot seem to find any folder path containing Editor/Data/Managed in the Unity application folder.
    (On a Mac, if that matters)

    Plenty of Managed folders, but non with "Editor" before it.
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    I guess that's Windows only path :). Editor is the root folder of installation on Windows - that's where the executable is. Probably Unity.app on Mac?

    Either case, the managed folder you want will have UnityEditor.dll next to UnityEngine.dll and couple others.
     
  15. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    The code won't work till you get your hands on beta 5. Like I said when I posted the link ;)
     
  16. Andreas Hesel

    Andreas Hesel

    Joined:
    Jul 24, 2015
    Posts:
    7
    The path on Mac is:
    Unity.app/Content/Frameworks/Managed/
    (Only place an UnityEditor.dll file is located in the Unity folder structure.)

    @tim: And right you were =). Getting all kinds of errors if I compile against the Beta4 dlls.
    Going forward it would still be nice to have the source code for the newest UI build, available at the release of each beta release (similar to the repository you set up in the beginning of this thread).

    Thank you both for your help. I'm just going to wait patiently for Beta 5 release.