Description
The Count
property of the GameObjectDirectory
class provides the total number of registered game objects and components within the directory. This property is useful for quickly determining the size of the directory, which includes both game objects and their associated components.
Usage
To access the Count
property, you need an instance of the GameObjectDirectory
class. This property is read-only and returns an integer representing the total count of game objects and components.
Example
// Assuming you have an instance of GameObjectDirectory
gameObjectDirectory = new GameObjectDirectory();
// Get the total count of game objects and components
int totalCount = gameObjectDirectory.Count;
// Output the count
// Note: Avoid using Console.WriteLine in s&box
// Instead, use a method appropriate for your context, such as logging or UI display
Log.Info($"Total GameObjects and Components: {totalCount}");