Version: 2023.1
언어: 한국어
public static void ImportPackage (string packagePath, bool interactive);

설명

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/Import Package Example")] static void ImportPackageExample() { var texturePackageNames = new[] {"groundTextures2k.unitypackage", "groundTextures4k.unitypackage"}; foreach (var package in texturePackageNames) { AssetDatabase.ImportPackage(package, false); } } }