Version: 2021.1
언어: 한국어

PrefabUtility.LoadPrefabContentsIntoPreviewScene

매뉴얼로 전환
public static void LoadPrefabContentsIntoPreviewScene (string prefabPath, SceneManagement.Scene scene);

파라미터

scene The Scene to load the contents into.
prefabPath The path of the Prefab Asset to load the contents of.

설명

Loads a Prefab Asset at a given path into a given preview 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. After that you can either reuse your preview scene for other purposes, or close the preview scene with EditorSceneManager.CloseScene.