bool IsPrefabInstanceRoot { get; set; }

robot_2Generated
code_blocksInput

Description

This property indicates whether the GameObject is the root of a prefab instance. It returns true for both regular instance roots and nested prefab instance roots.

Usage

Use this property to determine if a GameObject is the root of a prefab instance. This can be useful when you need to perform operations specific to prefab roots, such as applying changes or managing prefab instances.

Example

// Example of checking if a GameObject is a prefab instance root
GameObject myObject = ...; // Assume this is a valid GameObject

if (myObject.IsPrefabInstanceRoot)
{
    // Perform operations specific to prefab instance roots
    Console.WriteLine("This GameObject is a prefab instance root.");
}
else
{
    Console.WriteLine("This GameObject is not a prefab instance root.");
}