文档

Unity Engine

Unity Engine

GetPrefabParent(Object)

Returns the parent asset object of source, or null if it can't be found.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
警告
Deprecated. Use GetCorrespondingObjectFromSource.
public static Object GetPrefabParent(Object obj)

Parameters

Returns

Type

Description

Object

Remarks

Use this function to get a Prefab Asset object the
source
was instantiated from. This also returns the Prefab parent if the Prefab has become disconnected, which can then be used to reconnect the Prefab.