Author Topic: Getting started with NGUI Pro and an external library  (Read 6093 times)

appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Getting started with NGUI Pro and an external library
« on: May 31, 2013, 07:37:44 PM »
I'm trying to get up and running using NGUI Pro. Previously I was using the NGUI free trial version. I downloaded NGUI Pro and dragged the Assets\NGUI folder into my Unity project. That seemed to import everything. Is that the correct way to do that? I'm used to just dropping an asset file in.

Also, I've got an external C# library that I need to reference the NGUI classes in. I was able to do this in the free version of NGUI by referencing NGUI.DLL. That doesn't seem to exist in NGUI Pro, so I added the Assets\NGUI\Scripts folder to my project in Visual Studio and added Unity's UnityEditor.DLL and UnityEngine.DLL files, but when I compile, I get the following errors:

'UIWidget' does not contain a definition for 'showHandlesWithMoveTool'
'UIWidget' does not contain a definition for 'showHandlesl'

What is the correct way to reference the NGUI classes outside of Unity in lieu of a DLL to reference?

Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #1 on: June 01, 2013, 01:36:44 AM »
If you actually went with Pro (bitbucket access), then yup, drag & drop the NGUI folder is the way to go. Otherwise double-clicking on the package will import it.

NGUI is an editor extension, so a lot of the code relies on the existence of UnityEditor.dll for proper functionality, not to mention the fact that NGUI has a lot of platform-specific #ifdef's that won't be visible from within your DLL.

I do not advise using external DLLs with NGUI (or at all, for that matter).

appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #2 on: June 01, 2013, 06:18:12 AM »
Yes, I've got bitbucket access. The correct folder to drop into Unity is is ngui/Assets/NGUI? Dropping that into Unity I get an error when I try to build:

Assets/NGUI/Examples/Scripts/Other/LagPosition.cs(22,38): error CS0103: The name `UpdateManager' does not exist in the current context

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #3 on: June 01, 2013, 08:20:44 AM »
If you check it out from bitbucket, you'll get a path like so on the checked out project

myName/Assets/NGUI/...

Copy the NGUI folder and the meta file into your project (do it in windows explorer or Finder instead of dragging into Unity). Then start Unity and it should be fine.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #4 on: June 01, 2013, 02:55:37 PM »
That was actually my bad. I removed a file instead of moving it it seems. If you grab the latest, it'll be there.

appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #5 on: June 02, 2013, 10:32:04 AM »
That fixed it. Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Getting started with NGUI Pro and an external library
« Reply #6 on: June 02, 2013, 06:25:40 PM »
...I've also managed to b0rk the transform inspector slightly. That too has now been fixed.