vexe / VFW

MIT License
492 stars 67 forks source link

Not Git submodule friendly #39

Closed miguel12345 closed 9 years ago

miguel12345 commented 9 years ago

Hi,

Your plugin seems very good, and I was trying to use it in my current project. I always like to use submodules whenever possible but the way your project is structured is not very submodule-friendly.

I get these errors sometimes :

Parent directory must exist before creating asset at Assets/Plugins/Editor/Vexe/ScriptableAssets/BetterEditorPrefs.asset.
UnityEditor.AssetDatabase:CreateAsset(Object, String)
Vexe.Runtime.Types.BetterPrefs:GetEditorInstance() (at Assets/vfw/Assets/Plugins/Vexe/Runtime/Types/Others/BetterPrefs.cs:63)
Vexe.Runtime.Types.Startup:ResolveTick() (at Assets/vfw/Assets/VFW Misc/Requirements.cs:258)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
UnityException: Creating asset at path Assets/Plugins/Editor/Vexe/ScriptableAssets/BetterEditorPrefs.asset failed.
Vexe.Runtime.Types.BetterPrefs.GetEditorInstance () (at Assets/vfw/Assets/Plugins/Vexe/Runtime/Types/Others/BetterPrefs.cs:63)
Vexe.Runtime.Types.Requirements+Startup.ResolveTick () (at Assets/vfw/Assets/VFW Misc/Requirements.cs:258)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:264)

It makes sense since you are assuming that your plugin will be placed inside the assets folder in a very specific place, but I already have my own root Assets folder (as all Unity projects), and I had to clone your repo into Assets/vfw, which prevents your scripts from finding the correct path.

So, what I would suggest would be to rename your Assets root folder to VFW or something, allowing me to clone it normally inside my Assets folder.

vexe commented 9 years ago

Hey there,

yeah having flexible paths is one of things I have in my todo. The root is preferably "Assets" and the framework is preferably placed under "Plugins (or "Standard Assets" for that matter). That way it doesn't slow down or affect the compilation times of your ordinary scripts. AFAIK Plugins/Stadnard Assets only work if they're placed directly under "Assets"

That said, if you have no problems having a bit slower compilation/reload time, I can make my paths flexible without changing the root folder. i.e. to create that BetterEditorPrefs.asset I just look for "Editor/Vexe/ScriptableAssets/" and wherever that happens to be I place it there.

vexe commented 9 years ago

Feel free to reopen if that fix doesn't do it for, my tests shows it's OK.

miguel12345 commented 9 years ago

Thank you,

From what I know the plugins folder exists to hold native plugins (.dll's, .bundle's and so on) that you don't seem to be using, so , yes, while usually the Plugin folder must be placed in the root level (http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder), in this case it shouldn't matter because you don't seem to be using any native plugins.

Also, what do you mean with slowing down the compilation times of scripts? If your scripts are placed in a non-default place they do some extra logic, is that it?

vexe commented 9 years ago

http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html

Plugins or Standard Assets in my case, it doesn't matter. Both folders are compiled before the other scripts. If anything changes outside of those folders, Unity won't touch/reload them. But if you have everything compiled into one dll, Unity would recompile all the scripts. The link should make it clearer.

miguel12345 commented 9 years ago

Oh ok, I understand now, I wasn't aware of a specific compile phase for the Plugin folder. Thank you