This topic is not available in your language. Therefore, the original version (ja-jp) is displayed.

extract(args: ExtractArgs): Promise<void>

Signature

type ExtractArgs = {
  /**
   * file path to unitypackage
   */
  file: string;
  /**
   * unity project root directory
   */
  root: string;
  /**
   * transform input paths on write
   * @param path input file path (relative on root)
   * @returns input file path (relative on root)
   * @example filter: (path) => join("..", "Packages", "com.natsuneko.unitypackage", path); // Assets/MonoBehaviour.cs → Packages/com.natsuneko.unitypackage/MonoBehaviour.cs
   */
  transform?: (path: string) => string;
};
 
declare const extract: (args: ExtractArgs) => Promise<void>;
ParameterTypeRequiredDescription
filestringYes展開するアーカイブファイルのパス
rootstringYesプロジェクトのルートディレクトリへのパス
transform(path: string) => stringNo実態書き込み時にパスを書き換える場合の transform callback

Description

指定されたパラメータから、 UnityPackage ファイルを作成します。

例外

Exception NameDescription
ErrorThrown if file is empty or root is not directory

import { extract } from "@natsuneko-laboratory/unitypackage";
 
await extract({
  file: "./output.unitypackage",
  root: "./",
});
extract(args: ExtractArgs): Promise<void> / unitypackage / Natsuneko Laboratory Docs