PrefabUtility.GetCorrespondingObjectFromSource

切换到手册
public static Object GetCorrespondingObjectFromSource (Object source);

参数

sourceInstance object for which you want to find the corresponding prefab asset object.

返回

Object The corresponding asset object or null.

描述

返回 source 的相应资源对象,如果找不到,则返回 null。

Use this function to get a prefab asset object the source was instantiated from. This also returns the corresponding object from the prefab asset if the prefab instance has become disconnected, which can then be used to reconnect the prefab instance to the prefab asset.