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 updating or breaking from the prefab.

Example

// Example of checking if a GameObject is a prefab instance root
GameObject myObject = new GameObject();

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