Version: 2019.1
public static GameObject LoadPrefabContents (string assetPath);

パラメーター

assetPathThe path of the Prefab Asset to load the contents of.

戻り値

GameObject The root of the loaded contents.

説明

Loads a Prefab Asset at a given path into an isolated Scene and returns the root GameObject of the Prefab.

You can use this to get the content of the Prefab and modify it directly instead of going through an instance of the Prefab. This is useful for batch operations.

Once you have modified the Prefab you have to write it back using SaveAsPrefabAsset and then call UnloadPrefabContents to release the Prefab and isolated Scene from memory.