Guid Id { get; set; }

book_4_sparkGenerated
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 within the game environment. It is automatically assigned and managed by the system, ensuring that each component can be referenced and manipulated individually without conflicts.

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 specific component to be targeted. The Id is read-only and is automatically generated by the system, so you do not need to set it manually.

Example

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

// Use the Id to log or store the component reference
Debug.Log($"Component ID: {componentId}");