Hey, guys!
This is my open-source script which allows you to import *.unitypackage into a specified folder.
If you often need to import third-party packages, it’s a good idea to place them under “Plugins” folder to avoid recompilation with your regular scripts to save yourself some time.
Some assets are incompatible with Plugins folder, so you might want to import them into “Third Party” folder in your project to avoid bloating project’s root anyways.
It’s really annoying Unity doesn’t have such functionality out-of-the-box, so I decided to make a simple script for that.
It is available on the GitHub:
Allows to import Unity packages into specified folder to avoid your project's root bloating.
And it’s available on Asset Store too:
All your suggestions, ideas, and bug reports are welcomed, as always!
P.S. pull requests are very welcomed too!
4 Likes
Does this take care of the issue of hard-coded paths in assets as well? At one point, whenever I was importing an asset I’d manually move it after it finished importing. But I ran into too many assets with hard-coded paths.
Definitely sounds interesting though. I may give it a play sometime this week if I get a few minutes to take a breath… lol
Thanks for sharing!
1 Like
Hey, @BackwoodsGaming , thanks for your question and your interest!
No, it doesn’t touch imported files and not address issue with hardcoded paths.
Unfortunately, it’s nearly impossible to deal with it as paths may be constructed from different parts including non-static ones.
Actually, it’s a bad practice to use hardcoded paths and it should be addressed by assets devs themselves in first place, in ideal world.
BTW, I may add additional checks in future for the strictly top-level special folders which don’t work while nested.
1 Like
Aseemy
September 18, 2019, 2:33pm
4
facing this error when trying to import a package using this tool
Console Message
ArgumentException: method arguments are incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at :0)
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at :0)
CodeStage.PackageToFolder.Package2Folder.get_ExtractAndPrepareAssetList () (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:54)
CodeStage.PackageToFolder.Package2Folder.ImportPackageToFolder (System.String packagePath, System.String selectedFolderPath, System.Boolean interactive) (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:151)
CodeStage.PackageToFolder.Package2Folder.Package2FolderCommand () (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:128)
Using Unity 2018.4.6f1 on windows 10, let me know if this version is not supported
1 Like
Thanks for reporting this problem!
I’ll look into and will fix it with next update.
1 Like
@Aseemy
I believe it’s fixed now and update should be shortly available in the store.
Meanwhile, feel free to grab it on GitHub:
1 Like
Aseemy
October 16, 2019, 7:21pm
7
Wow, thanks for the quick fix. unfortunately i didnt get a notification. but i tried it now and its working perfectly.
1 Like
Hi i got this error by importing(Unity 2019.3.11f1:
ArgumentException: method argument length mismatch
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at <437ba245d8404784b9fbab9b439ac908>:0)
CodeStage.PackageToFolder.Package2Folder.get_ExtractAndPrepareAssetList () (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:54 )
CodeStage.PackageToFolder.Package2Folder.ImportPackageToFolder (System.String packagePath, System.String selectedFolderPath, System.Boolean interactive) (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:149 )
CodeStage.PackageToFolder.Package2Folder.Package2FolderCommand () (at Assets/Plugins/CodeStage/Package2Folder/Scripts/Package2Folder.cs:128 )
Hey @viktorkadza
Thank you for reporting this (got your email as well).
Internal API has changed (again), I’ll investigate and fix it with next update!
1 Like
Hey @viktorkadza ,
It should be fixed now on GitHub (and will appear on the store as well after review).
1 Like
Glad to let you know Package2Folder got a new 1.2.0 update, available both on Asset Store and GitHub !
Now you can install it through the Unity Package Manager using Git URL:
https://github.com/Code-Stage/Package2Folder.git
Make sure to remove the previous version before installing a new package.
Release Notes
Added
Add assetOrigin argument support to ImportPackageToFolder API
Changed
Refactor asset into UPM package, can add to the project now with direct git link
Improve paths handling
1 Like