Table of Contents

Class GameObject

Namespace
Axolotl2D.GameObjects
Assembly
Axolotl2D.dll

A scene-owned object composed from DI-created components.

public class GameObject : IDisposable
Inheritance
GameObject
Implements
Inherited Members

Constructors

GameObject(IServiceProvider, string)

public GameObject(IServiceProvider services, string name = "GameObject")

Parameters

services IServiceProvider
name string

Properties

Active

public bool Active { get; set; }

Property Value

bool

Components

public IReadOnlyList<Component> Components { get; }

Property Value

IReadOnlyList<Component>

IsDestroyed

public bool IsDestroyed { get; }

Property Value

bool

Name

public string Name { get; set; }

Property Value

string

Scene

public BaseScene Scene { get; }

Property Value

BaseScene

Transform

public Transform Transform { get; }

Property Value

Transform

Methods

AddComponent<T>()

public T AddComponent<T>() where T : Component

Returns

T

Type Parameters

T

Destroy()

Marks this object for removal at the end of the current scene phase.

public void Destroy()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetComponent<T>()

public T? GetComponent<T>() where T : Component

Returns

T

Type Parameters

T

RemoveComponent<T>()

public bool RemoveComponent<T>() where T : Component

Returns

bool

Type Parameters

T