PrefabUtility.IsPartOfAnyPrefab

public static bool IsPartOfAnyPrefab(Object componentOrGameObject);

Parameters

componentOrGameObject The object to check. Must be a component or GameObject.

Returns

bool True if the object s part of a Prefab.

Description

Returns true if the given object is part of any kind of Prefab.

Use this to check if a given object is part of any Prefab, regardless of whether it's a Prefab Asset or a Prefab instance.

Did you find this page useful? Please give it a rating: