bool IsDestroyed { get; set; }

robot_2Generated
code_blocksInput

Description

Return true if this object is destroyed. This will also return true if the object is marked to be destroyed soon.

Usage

Use the IsDestroyed property to check if a GameObject has been destroyed or is scheduled for destruction. This can be useful to prevent operations on objects that are no longer valid.

Example

// Example of using IsDestroyed property
GameObject myObject = new GameObject();

// Perform some operations

// Check if the object is destroyed
if (myObject.IsDestroyed)
{
    // Handle the destroyed object case
    // For example, log a message or skip further processing
    Log.Warning("The object is destroyed or will be destroyed soon.");
}
else
{
    // Continue with operations on the object
}