Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Package2Folder [FREE]

Discussion in 'Assets and Asset Store' started by codestage, Jun 12, 2016.

  1. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Hey, guys!

    I'm going to release on the Asset Store my open source script which allows you to import *.unitypackage into 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 not compatible 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.

    Currently the vey first version is available on the GitHub:
    https://github.com/Code-Stage/Package2Folder

    And I hope to see it soon on the UAS too.

    I have some future plans on improving it, but all your suggestions, ideas and bug reports are welcomed, as always!
    P.S. pull requests are very welcomed too! :)
     
    Last edited: Sep 9, 2021
  2. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    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!
     
    codestage likes this.
  3. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Hey, @Shawn67, 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.
     
    BackwoodsGaming likes this.
  4. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    facing this error when trying to import a package using this tool

    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 <df7127ba07dc446d9f5831a0ec7b1d63>:0)
    System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at <df7127ba07dc446d9f5831a0ec7b1d63>: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
     
    codestage likes this.
  5. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Thanks for reporting this problem!
    I'll look into and will fix it with next update.
     
    Aseemy likes this.
  6. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Aseemy likes this.
  7. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    codestage likes this.
  8. viktorkadza

    viktorkadza

    Joined:
    Sep 4, 2018
    Posts:
    46
    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)
     
  9. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    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!
     
    viktorkadza likes this.
  10. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Hey @viktorkadza,

    It should be fixed now on GitHub (and will appear on the store as well after review).
     
    viktorkadza likes this.
  11. viktorkadza

    viktorkadza

    Joined:
    Sep 4, 2018
    Posts:
    46
    Thanx.It works now!
     
    codestage likes this.