Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetPrefabParent(Object)

Returns the parent asset object of source, or null if it can't be found.
Read time 1 minuteLast updated 11 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
Warning
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.