기술 자료

Unity Engine

Unity Engine

CreatePrefab

Creates a Prefab from a game object hierarchy.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

CreatePrefab(string, GameObject)

Creates a Prefab from a game object hierarchy.
경고
Deprecated. Use SaveAsPrefabAsset instead.
public static GameObject CreatePrefab(string path, GameObject go)

Parameters

path

The path where the Prefab is saved.

The GameObject that you want to create a Prefab from.

Returns

Type

Description

GameObjectA reference to the created Prefab.

Remarks

Use this to create a Prefab from a GameObject in the hierarchy, and give it a path to save the Prefab in.

CreatePrefab(string, GameObject, ReplacePrefabOptions)

Creates a Prefab from a game object hierarchy.
경고
Deprecated. Use SaveAsPrefabAsset or SaveAsPrefabAssetAndConnect instead.
public static GameObject CreatePrefab(string path, GameObject go, ReplacePrefabOptions options)

Parameters

path

The path where the Prefab is saved.

The GameObject that you want to create a Prefab from.

Returns

Type

Description

GameObjectA reference to the created Prefab.

Remarks

Use this to create a Prefab from a GameObject in the hierarchy, and give it a path to save the Prefab in.