Author Topic: Is it possible to refer to an NGUI class in an external library?  (Read 3476 times)

appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Is it possible to refer to an NGUI class in an external library?
« on: November 22, 2013, 03:21:18 PM »
NGUI doesn't seem to lend itself to external references. There's no DLL, and the Unity editor is so ingrained in the scripts that even compiling a DLL leads to all sorts of errors at run time. We want to move some of our functionality to an external library, so that it may span projects, but we're finding that we're unable to do this if we need to refer to a specific NGUI class (e.g. UIWidget). We could individually move the ones that we want out of the Unity side and into our library, but that would be need to be maintained and any updates to NGUI would need managing. Plus all of the editor stuff baked into the classes (e.g. the custom inspectors) generally cause problems.

I'm at somewhat of a loss on this. Is there a way to refer to an NGUI class in an external library? Or is this simply not possible?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible to refer to an NGUI class in an external library?
« Reply #1 on: November 22, 2013, 04:01:14 PM »
NGUI is very editor-dependent on much of its functionality due to platform-specific code. UIInput is the best (or worst?) example of this where there needs to be different handling for different platforms. EventDelegate is another. Some code that compiles on one platform won't compile on another.

KeldorKatarn

  • Guest
Re: Is it possible to refer to an NGUI class in an external library?
« Reply #2 on: December 06, 2013, 09:35:36 PM »
I'm running into the same problem with some libraries here. my question is... if this is so difficult to do for third party libraries... then how on earth is Unity going to handle this with its own new GUI?

Are you telling me that will not end up in the UnityEngine.dll but will have to be put into every project as scripts? That sounds very strange.

I'm really disappointed by now on how incompatible Unity is with having external code. First the problems with Behaviors that are not found in hierarchies that span across several assemblies which already forced us to merge framework and game code into one project... and now this... inability to use third-party GUI libraries because we cannot link to them.

This might now force us to move our code from external completely into the Unity project which pretty much ruins the entire process of having the code independent from the Unity editor. No automatic builds of the code anymore, no automatic running of tests, nothing. All compilation will have to be done in the editor and every artist will have to constantly recompile the entire codebase.

Frankly that sucks to a degree I can't even describe...