GameObjectCollection Class
Type-associated table of indexed game objects, e.g., {classA = {object1, object2}, ...}.
Private Properties
- _objects
GameObjectCollectionType: Internal storage for game objects.
Public Methods
new()
Creates a new instance of the GameObjectCollection class.
Returns:
GameObjectCollection
insertObject(object)
Inserts an object of a specific type.
Parameters:
objectGameObject: The game object to insert.
gameObjectArray(type)
Gets an array of game objects by type.
Parameters:
typeT:GameObject: The type of game object.
Returns:
T[]?: Array of game objects ornilif none exist.
firstOfType(type)
Returns the first element of a specific type.
Parameters:
typeT:GameObject: The type of game object.
Returns:
T?: The first element ornilif none exist.