int LastUsed { get; set; }

robot_2Generated
code_blocksInput

Description

The LastUsed property of the Texture class provides information about the last time the texture was utilized by the renderer. It returns an integer value representing the number of frames that have passed since the texture was last used. This can be useful for optimizing resource management by identifying textures that are no longer in active use.

Usage

To access the LastUsed property, you need an instance of the Texture class. This property is read-only and provides an integer value indicating the number of frames since the texture was last rendered.

Example

// Assuming 'texture' is an instance of Sandbox.Texture
int framesSinceLastUsed = texture.LastUsed;

if (framesSinceLastUsed > 100)
{
    // Consider releasing or reusing the texture
}