Guid Id { get; set; }

robot_2Generated
code_blocksInput

Description

The Id property of a Component in the Sandbox framework is a unique identifier of type System.Guid. This identifier is used to uniquely distinguish each component instance within the game environment. It is automatically assigned and managed by the system, ensuring that each component can be reliably identified and referenced.

Usage

Use the Id property when you need to uniquely identify a component, for example, when storing references to components or when performing operations that require a unique component identifier. This property is read-only and is automatically set by the system, so you do not need to manually assign it.

Example

// Example of accessing the Id property of a component
Component myComponent = new Component();
System.Guid componentId = myComponent.Id;

// Use the Id for logging or tracking
Debug.Log($"Component ID: {componentId}");