Table of Contents

Class Component

Namespace
AO
Assembly
CoreAssembly.dll

Base component class.

public abstract class Component
Inheritance
Component
Derived
Inherited Members
Extension Methods

Remarks

Do not create instances of this class directly. Use Entity.AddComponent to add components to entities.

Constructors

Component()

public Component()

Fields

Entity

The entity this component is attached to

public Entity Entity

Field Value

Entity

Properties

LocalEnabled

Is the component enabled.

public bool LocalEnabled { get; set; }

Property Value

bool

Position

Wrapper for Entity.Position.

public Vector2 Position { get; }

Property Value

Vector2

WorldEnabled

Is the component enabled and the entity its on and all parent entities are all enabled.

public bool WorldEnabled { get; }

Property Value

bool

Methods

AddComponent<T>()

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

Returns

T

Type Parameters

T

Awake()

Called when the component is created. Call Awaken() if you need this to happen immediately. If Awake() was already called, Awaken() does nothing.

public virtual void Awake()

Awaken()

Force a component to awaken. Useful to call on child objects in the parent's Awake() when you need the children to initialize first.

public void Awaken()

GetComponent<T>()

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

Returns

T

Type Parameters

T

LateUpdate()

Called every frame the entity is enabled, after all Update methods have been called.

public virtual void LateUpdate()

OnDestroy()

Called when the entity is destroyed.

public virtual void OnDestroy()

PredictLateUpdate(uint)

Called multiple times per frame during client-side prediction, after all PredictUpdate methods have been called. Called as many times as the number of ticks being resimulated. Minimize the amount of work done in this function to only the logic which should be client-side predicted.

public virtual void PredictLateUpdate(uint frameNumber)

Parameters

frameNumber uint

PredictUpdate(uint)

Called multiple times per frame during client-side prediction. Called as many times as the number of ticks being resimulated. Minimize the amount of work done in this function to only the logic which should be client-side predicted.

public virtual void PredictUpdate(uint frameNumber)

Parameters

frameNumber uint

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Update()

Called every frame the entity is enabled.

public virtual void Update()