Version: 2019.2

PrefabUtility.LoadPrefabContentsIntoPreviewScene

マニュアルに切り替える
public static void LoadPrefabContentsIntoPreviewScene (string prefabPath, SceneManagement.Scene scene);

パラメーター

sceneThe Scene to load the contents into.
prefabPathThe 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 and then call UnloadPrefabContents to release the Prefab and isolated Scene from memory.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961