Api Sandbox GameObjectDirectory
class

GameObjectDirectory

public sealed class GameObjectDirectory

New GameObjects and Components are registered with this class when they're created, and unregistered when they're removed. This gives us a single place to enforce Id uniqueness in the scene, and allows for fast lookups by Id.

Properties

Name Type Description
Count Int32
GameObjectCount Int32
ComponentCount Int32

Methods

Component FindComponentByGuid(Guid guid)

Find a Component in the scene by Guid. This should be really really fast.

GameObject FindByGuid(Guid guid)

Find a GameObject in the scene by Guid. This should be really really fast.

IEnumerable<GameObject> FindByName(String name, Boolean caseinsensitive = True)

Find objects with this name. Not performant.

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.GameObjectDirectory