기술 자료

Unity Engine

Unity Engine

ReplacePrefab

Replaces the targetPrefab with a copy of the game object hierarchy go.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

ReplacePrefab(GameObject, Object)

Replaces the targetPrefab with a copy of the game object hierarchy go.
경고
Deprecated. Use SaveAsPrefabAsset with a path instead.
public static GameObject ReplacePrefab(GameObject go, Object targetPrefab)

Parameters


targetPrefab

Returns

Type

Description

GameObject

Remarks

Returns the Prefab game object after it has been created. If connectToPrefab is enabled go will be made an instance of the created Prefab.

ReplacePrefab(GameObject, Object, ReplacePrefabOptions)

Replaces the targetPrefab with a copy of the game object hierarchy go.
경고
Deprecated. Use SaveAsPrefabAsset or SaveAsPrefabAssetAndConnect with a path instead.
public static GameObject ReplacePrefab(GameObject go, Object targetPrefab, ReplacePrefabOptions replaceOptions)

Parameters


targetPrefab


replaceOptions

Returns

Type

Description

GameObject

Remarks

Returns the Prefab game object after it has been created. If connectToPrefab is enabled go will be made an instance of the created Prefab.