Description
The Get<T>
method in the Scene
class is used to retrieve the first object of a specified type T
within the scene. This object could be a component, a GameObjectSystem
, or potentially other types in the future. The method is marked with the [Pure]
attribute, indicating that it does not cause any observable state changes.
Usage
To use the Get<T>
method, you need to specify the type of object you are looking for as the generic type parameter. The method will return the first instance of that type found in the scene.
Example
// Example of using the Get<T> method
// Assuming you have a component type MyComponent
MyComponent myComponent = scene.Get<MyComponent>();
if (myComponent != null)
{
// Do something with the component
}