class Component

in global :: Sandbox

A GameObject can have many components, which are the building blocks of the game.


public Scene Scene { get; }

The scene this Component is in. This is a shortcut for `GameObject.Scene`.

public GameTransform Transform { get; }

The transform of the GameObject this component belongs to. Components don't have their own transforms but they can access the transform of the GameObject they belong to. This is a shortcut for `GameObject.Transform`.

public GameObject GameObject { get; }

The GameObject this component belongs to.

public ComponentList Components { get; }

Access components on this component's GameObject

public bool Enabled { get; set; }

The enable state of this . This doesn't tell you whether the component is actually active because its parent might be disabled. This merely tells you what the component wants to be. You should use to determine whether the object is truly active in the scene.

public bool Active { get; }

True if this Component is enabled, and all of its ancestor GameObjects are enabled

public void EditLog( string name, object source )

Called when something on the component has been edited

public ITagSet Tags { get; }

🤡 Doc inheritance is not yet supported.

No summary.

public void Invoke( float secondsDelay, Action action, CancellationToken ct = null )

Invoke a method in x seconds. Won't be invoked if the component is no longer active.

public DebugOverlaySystem DebugOverlay { get; }

Allows drawing of temporary debug shapes and text in the scene

public Transform LocalTransform { get; set; }

The local transform of the game object.

public Vector3 LocalPosition { get; set; }

The local position of the game object.

public Rotation LocalRotation { get; set; }

The local rotation of the game object.

public Vector3 LocalScale { get; set; }

The local scale of the game object.

public bool IsProxy { get; }

True if this is a networked object and is owned by another client. This means that we're not controlling this object, so shouldn't try to move it or anything.

public void DeserializeImmediately( JsonObject node )

Deserialize this component as per but update and property references immediately instead of having them deferred.

public int ComponentVersion { get; }

The version of the component. Used by .

public Transform WorldTransform { get; set; }

The world transform of the game object.

public Vector3 WorldPosition { get; set; }

The world position of the game object.

public Rotation WorldRotation { get; set; }

The world rotation of the game object.

public Vector3 WorldScale { get; set; }

The world scale of the game object.

public GameObject.NetworkAccessor Network { get; }

😔 No documentation found.

public Guid Id { get; }

😔 No documentation found.

public void Deserialize( JsonObject node )

😔 No documentation found.

public static void JsonWrite( object value, Utf8JsonWriter writer )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public JsonNode Serialize( GameObject.SerializeOptions options = null )

😔 No documentation found.

public static object JsonRead( ref Utf8JsonReader reader, Type targetType )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public IEnumerable<T> GetComponents( bool includeDisabled = False )

😔 No documentation found.

public bool IsValid { get; }

😔 No documentation found.

public Action OnComponentEnabled { get; set; }

😔 No documentation found.

public Action OnComponentStart { get; set; }

😔 No documentation found.

public Action OnComponentUpdate { get; set; }

😔 No documentation found.

public Action OnComponentFixedUpdate { get; set; }

😔 No documentation found.

public Action OnComponentDisabled { get; set; }

😔 No documentation found.

public Action OnComponentDestroy { get; set; }

😔 No documentation found.

public void Destroy( )

😔 No documentation found.

public void DestroyGameObject( )

😔 No documentation found.

public void Reset( )

😔 No documentation found.

public ComponentFlags Flags { get; set; }

😔 No documentation found.

public T AddComponent( bool startEnabled = True )

😔 No documentation found.

public T GetOrAddComponent( bool startEnabled = True )

😔 No documentation found.

public T GetComponent( bool includeDisabled = False )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public IEnumerable<T> GetComponentsInChildren( bool includeDisabled = False, bool includeSelf = True )

😔 No documentation found.

public T GetComponentInChildren( bool includeDisabled = False, bool includeSelf = True )

😔 No documentation found.

public T GetComponentInParent( bool includeDisabled = False, bool includeSelf = True )

😔 No documentation found.

public IEnumerable<T> GetComponentsInParent( bool includeDisabled = False, bool includeSelf = True )

😔 No documentation found.