Imports package at packagePath into the current project.
If interactive is true, an import package dialog will be opened, else all assets in the package will be imported into the current project.
using UnityEditor; using UnityEngine;
public class AssetDatabaseExamples : MonoBehaviour { [MenuItem("AssetDatabase/ImportPackageExample")] static void ImportPackageExample() { var texturePackageNames = new[] {"groundTextures2k.unitypackage", "groundTextures4k.unitypackage"}; foreach (var package in texturePackageNames) { AssetDatabase.ImportPackage(package, false); } } }
Did you find this page useful? Please give it a rating: