User avatar
jashan
Topic Author
Posts: 13
Joined: 23 Mar 2013, 18:15
Contact:

Folder Layout of Noesis Unity Package

30 Mar 2013, 18:41

When I first tried Noesis, I added it to an existing project - and the current folder layout you're using for the plugin really gave me some trouble with that. Currently, you have 5 top level folders, 3 of which are specific to NoesisGUI and the other two being the "Plugins" and "StreamingAssets" folder. I think StreamingAssets is already perfect the way it is ;-)

Since NoesisGUI is a "plugin", I'd say that most of this stuff should go into Plugins - but with a subfolder (because in most projects, there will already be quite a bit of stuff in Plugins and it's not so nice to mix this).

One possibility would be having
Plugins
- Noesis
  + Folder DLLs (contains all the DLLs, manifest and yes files)
  + Folder "Kernel" (or some better name for NoesisKernel*, NoesisKeyCodes, NoesisLibrary and so on)
  + Folder Proxies
  + File NoesisGUI.cs
- Android - not sure if this can't also go below Noesis (would be preferable IMHO)
There's one tricky thing with that: NoesisGUI has a dependency on NoesisRegisterClasses - and NoesisRegisterClasses has a dependency on TicTacToe. This also means that if one deletes the examples, compilation will break ... so that probably has to be fixed anyways.

Also, there's a little fix in the code needed for the DLLs to work properly in their new location: NoesisKernel.GetLibraryDirectory() would have:
return System.IO.Path.Combine(UnityEngine.Application.dataPath, "Plugins/Noesis/DLLs");
(instead of just "Plugins")

With that fix, it does work in the editor - but not when doing a standalone build. I'm not sure why that fails but probably that can be fixed somehow ;-)

There's one very important thing you need to keep in mind: When people update your package, even when your package has a new folder layout, this won't change the layout people have in their project. So that's a change you should definitely do before you release - otherwise, you'll be kind of locked into a layout that quite a few people will be very unhappy with.

Some asset store vendors handle this by saying "when you upgrade, delete my package, then re-import" - which works fine if your package is just a single folder (like with NGUI, for instance). But if you're package spreads into various locations into your customers' projects, this will most likely become too complicated for most people.

The contents from Scripts/Editor might best be located in Editor / NoesisGUI or Editor / Noesis (this should probably be consistent - since the product is called NoesisGUI, I guess that would be a better name than Noesis).
Editor
- NoesisGUI
  + NoesisBuildToolKernel
  + ...
The folder "NoesisGUI" could probably be called "NoesisGUI-Examples" and the folder "Scenes" could go right below that, like:
NoesisGUI-Examples
- Demos
- Gui
- Scenes
  + MasterMind
  + ...
I'm sorry for giving this kind of feedback this late in the process - but I just arrived in the beta a very short time ago and to actually play with it, I needed to install Bootcamp ;-)
 
User avatar
sfernandez
Site Admin
Posts: 3222
Joined: 22 Dec 2011, 19:20

Re: Folder Layout of Noesis Unity Package

01 Apr 2013, 12:41

Hi jashan,

Folder layout in Unity is one thing we would appreciate the collaboration of all of you, because we've seen many different layouts in already released plugins to make us think there is no standard or recommendation about :?

We initially tried to put everything inside Plugins/Noesis folder but found that when a windows standalone was generated, Unity only copied .dll files located under Plugins root directory. The same occurs for Android standalones, Unity only copied .so files located under Plugins/Android root directory.

We are glad to read more opinions about this topic ;)
 
User avatar
jashan
Topic Author
Posts: 13
Joined: 23 Mar 2013, 18:15
Contact:

Re: Folder Layout of Noesis Unity Package

02 Apr 2013, 12:17

Oh ... if Unity only copies DLLs from directly below Plugins, that's what I would all a Unity bug ;-)

There's a few postings about folder layout for packages on the Unity forums:

Asset Store Submission Process Video & Template Images
http://forum.unity3d.com/threads/89780- ... ages/page2

It starts with Rafes posting "Plugin and Editor folder installation done right", Posted: 05:47 PM 08-13-2012 (that's on the lower part of page 2 on the link above).

Unfortunately, up until now there really is no official guideline which can cause quite a bit of mess up when using packages from different publishers. As far as I can see, one thing that quite a few do is simply put everything under a folder "PackageName". Like, NGUI, for example does it this way. The nice thing about this is that it makes it very easy to see what belongs to that specific package. The problem is that classes may not be available in languages like UnityScript of Boo unless one moves classes under Plugins.

That's where Rafes' and my suggestions are coming from: Find a folder layout that is both clean and works for most people.
 
User avatar
sfernandez
Site Admin
Posts: 3222
Joined: 22 Dec 2011, 19:20

Re: Folder Layout of Noesis Unity Package

09 Apr 2013, 12:18

Hi jashan, thanks for the supplied info.

We read and talked about this topic and decided to layout Unity plugin as follows:
- Assets/

  - NoesisGUI Examples/
    + MasterMind/
    + Primitives/
    + RenderToTexture/
    + SampleGallery/
    + TicTacToe/

  - NoesisGUI/
    + Data/                  (place here xaml and font assets following NoesisGUI data structure)
    - Scripts/
      + Editor/              (contains editor scripts)
      + Proxies/             (contains wrappers for NoesisGUI framework classes)
      + Core/                (contains NoesisKernel*, NoesisLibrary, ... scripts)
      . NoesisGUIPanel.cs

  - Plugins/
    - Android/
      . libNoesisGUI.so
    - iOS/
      . libNoesisGUI.a
    . NoesisGUI.dll

  - StreamingAssets/
    - NoesisGUI/
      - Data/                (would contain xaml and fonts built for each platform)
        + ANDROID/
        + DX9/
        + GL/
        + IOS/
We hope this new layout will make it easier to manage NoesisGUI plugin contents and upgrade process.

Waiting for your feedback... ;)
 
User avatar
jashan
Topic Author
Posts: 13
Joined: 23 Mar 2013, 18:15
Contact:

Re: Folder Layout of Noesis Unity Package

09 Apr 2013, 16:29

That looks fine to me - can't wait to get the next build :-)

While I personally prefer having stuff under Plugins and Editor, the approach of having a top-folder with the name of the package is common enough.

There's one limitation with this approach you need to be aware of, though: Due to the script compilation order that Unity uses, it will be more difficult for people using UnityScript or Boo to use NoesisGUI because they can't access the classes defined below NoesisGUI/Scripts from their UnityScript/Boo-code.

Putting what you have under NoesisGUI/Scripts under the folder Plugins/NoesisGUI/ would solve that problem because whatever scripts are in the plugins folder are compiled first. That way, it's easy to use those classes from UnityScript/Boo. Personally, I don't use either of those - but quite a few people do (C#: 38%, UnityScript: 29%).

See also the poll in: Boo, C# and JavaScript in Unity - Experiences and Opinions
 
User avatar
sfernandez
Site Admin
Posts: 3222
Joined: 22 Dec 2011, 19:20

Re: Folder Layout of Noesis Unity Package

22 May 2013, 16:59

Last release (v0.9.9) will feature a new layout, following the suggestions from this topic and the related documentation (thanks for that valuable info jashan ;) ).
- Assets/

  - NoesisGUI/                     (contains scene data following NoesisGUI data structure)
    - Demos/
      + ControlGallery/
    - Gui/
      + MasterMind/
      + Primitives/
      + RenderToTexture/
      + Samples/
      + TicTacToe/

  - Plugins/
    - NoesisGUI/
      - Scripts/
        + Proxies/                  (contains wrappers for NoesisGUI framework classes)
        + Core/                     (contains NoesisKernel*, NoesisLibrary, ... scripts)
        . NoesisGUIPanel.cs
    - Android/
      . libNoesisGUI.so
    - iOS/
      . libNoesisGUI.a
    . NoesisGUI.dll

  - Editor/
      + NoesisGUI/                  (contains editor scripts)

  - StreamingAssets/
    - NoesisGUI/
      - Data/                       (would contain xaml and fonts built for each platform)
        + ANDROID/
        + DX9/
        + GL/
        + IOS/
The first root folder is NoesisGUI. This folder should contain all the assets needed by a scene (mandatory for xaml and font resources), organized according to NoesisGUI data structure, that is,
> NoesisGUI/<module_name>/<package_name>/Content/<assets>

Next folder, Plugins, will contain in the first level NoesisGUI libraries. We would prefer to place them inside a subfolder, but Unity standalone generation only searches for libraries placed directly inside Plugins folder. It will also contain a NoesisGUI subfolder for main plugin scripts. We decided to place them here to allow JavaScript and Boo scripts to access NoesisGUI API.

Editor scripts will be placed inside Editor/NoesisGUI.

And the last folder, StreamingAssets, will contain all xaml and font resources that where correctly placed under Assets/NoesisGUI, built for each selected platform, ready to be used by NoesisGUI plugin.

We hope this new layout better fits the needs of our users :)

Who is online

Users browsing this forum: Google [Bot] and 2 guests