Search Unity

Is it possible to Export Package without scripts?

Discussion in 'Editor & General Support' started by Dreamwriter, Mar 23, 2017.

  1. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    I have three separate projects I want to merge into one. One of those projects, that I am using as the new base, has a nicely organized, much better optimized script structure. I don't need any of the legacy scripts from the old projects, and can re-link the necessary scripts as needed.

    So the question is, how can I export a package that is only the assets and non-script dependencies, such as shaders, textures, and materials? Sure, a person could go through and uncheck all of the scripts after it adds them, but there are literally thousands of scripts all over the project - the old projects were very poorly organized. To do that manually with all of the scenes in all of the projects would take eons, especially since most of these scenes are so gigantic that it slows all of Unity Editor to a crawl.

    Any idea? Is there an easy way to do this through scripting rather than the default Export Package editor menu?
     
    sirleto likes this.
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You can create a simple editor script that calls AssetDatabase.ExportPackage to create your package.

    This method takes an array of asset paths. you can easily create this list and exclude any scripts (or other asset types) that you want to filter out from the generated package.