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
servicesIServiceProvidernamestring
Properties
Active
public bool Active { get; set; }
Property Value
Components
public IReadOnlyList<Component> Components { get; }
Property Value
IsDestroyed
public bool IsDestroyed { get; }
Property Value
Name
public string Name { get; set; }
Property Value
Scene
public BaseScene Scene { get; }
Property Value
Transform
public Transform Transform { get; }
Property Value
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
Type Parameters
T