Author Topic: New User Install Notes  (Read 3823 times)

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
New User Install Notes
« on: July 18, 2012, 12:51:52 AM »
Hi,

I wanted to post this while it is still fresh.

1) Is there a reason why you don't use the Plugins and Editor folders? All of our plugins are distributed to do this and it works great! This is pretty standard and it keeps things clean and works for JavaScript users, since these assemblies run first. You can also use the internal modifier in your code which can be handy. Folder structure example...
    Assets
        Plugins
            nGUI
                ...
        Editor
            nGUI
                ...

2) You use a lot of the same component names as EZGUI, which we also have. I had to refactor some code and reinstall to get nGUI to work. I am generally a fan of generic naming, but it would be nice to add use "nGUI" instead of "UI" as a prefix. I know changing this would require all users to update their code, but I wanted to point it out, even if just to warn others before import.


Awesome, awesome job!

dlewis

  • Guest
Re: New User Install Notes
« Reply #1 on: July 18, 2012, 12:58:00 AM »
2) You use a lot of the same component names as EZGUI, which we also have. I had to refactor some code and reinstall to get nGUI to work. I am generally a fan of generic naming, but it would be nice to add use "nGUI" instead of "UI" as a prefix. I know changing this would require all users to update their code, but I wanted to point it out, even if just to warn others before import.

I agree that strongly named classes would be good but the way it is it's hard to say "X is the same as Y", both/all packages that are the same are both at fault (although I don't see why you would want NGUI and EzGUI).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New User Install Notes
« Reply #2 on: July 18, 2012, 02:02:09 AM »
NGUI is not meant to play well with EZGUI. It's meant as an alternative, not as a side-by-side package. I chose to keep it simple with the UI prefix early on, and it's too late to change it now.

The reason NGUI is not in plugins by default is because I wanted to keep it all in one folder, which makes upgrading very simple. For the first 4 months of NGUI's development I was doing builds every 2 days, and this was essential for clarity. Besides when putting a package on the asset store, you get to specify one folder. Plugins and Editor would be two... so it would need to be:

Assets
- NGUI
-- Plugins
--- NGUI
-- Editor
--- NGUI

..etc. It's just not clean.

It's much easier to have a FAQ that explains which 4 folders you need to drag over to Plugins to make it work with Javascript.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: New User Install Notes
« Reply #3 on: July 18, 2012, 01:52:44 PM »
Just for completeness... It works fine with the AssetStore. In our plugin/middleware projects we just select the Assets folder and they automatically remove the AssetStoreTools folder. I've been doing it this way with all of our plugins for quite some time. It installs as expected and is very clean, works for JavaScript and C# and is really designed to be this way, so things run in the right order (Plugins first, etc). I have told the AssetStore guys to make this clear so many times but they haven't done so.

What is really nice, is that if you release a second plugin or extension, and have common code, you can put it in a folder and it will merge on import automatically. What I mean is, if you have these two pacakges to import:
- Assets
--- Plugins
----- Tasharen
------- Common
--------- SomeLib.cs
------- NGUI
--------- ...

and

- Assets
--- Plugins
----- Tasharen
------- Common
--------- SomeLib.cs
------- OtherPlugin
--------- ...

You end up with:
- Assets
--- Plugins
----- Tasharen
------- Common
--------- SomeLib.cs
------- NGUI
--------- ...
------- OtherPlugin
--------- ...

From a user standpoint it is more clear too, since all my plugins are in the plugins folder and their editors are in the same folder but under Editors.

The other nice thing is that you don't have to ask people to move files around, which makes installing updates kind of confusing.

I know this would be a big change. I am just sharing for information's sake. I learned this stuff over the last year+ as we released our three packages.

P.S. I know nGUI is not meant to be used side by side with EZGUI, but I needed both in my project as I switch over. I bet there aren't many users that would switch at such a late stage in their game, but it would have been nice to have a warning anyway. I didn't expect you to actually change your code. I simply refactored all the EZGUI types to have "EZ" before their names, then imported nGUI without issue.

Thanks again for nGUI. It is fabulous.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New User Install Notes
« Reply #4 on: July 18, 2012, 02:33:40 PM »
Your approach does not address the need to have the Editor folder outside the Plugins folder in order for it to work.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: New User Install Notes
« Reply #5 on: July 18, 2012, 06:39:12 PM »
Your approach does not address the need to have the Editor folder outside the Plugins folder in order for it to work.
It is a sibling folder. The project hierarchy view would look like this when you submit to the AssetStore and choose "Assets":

(Assets)
 - AssetStoreTools     <-- Removed by Unity on submission
 - Plugins
 - - Tasharen
 - - - nGUI     <-- All non-editor files can go in here
 - Editor
 - - Tasharen
 - - - nGUI
 - nGUIExampleFiles     <-- easy to delete, optional to load (easy to find in load window). Not core files


Using our plugins as an example. If a user were to import PoolManager and TargetPRO (which includes UnityConstraints), they would get this (I'll assume they didn't import the example files to keep this shorter):

 - Plugins
 - - Pathological
 - - - PoolManager
 - - - TargetPRO
 - - - UnityConstraints
 - Editor
 - - Pathological
 - - - Common
 - - - PoolManager
 - - - TargetPRO
 - - - UnityConstraints


Another benefit I just remembered is that when the project is synced with an IDE like Visual Studio, it puts the files in the right assemblies for easy access.

FWIW I have actually seen other developers alter their projects to use this structure. They generally push up a half or full version though, since users need to take a manual step before upgrading (move the files to match, then import the new files, so Unity keeps track of the change and doesn't dump components on prefabs etc.)