Home Reference Source Test
public class | source

Component

Extends:

Updateable → Component

A component may be added to any GameObject by using GameObject's function: addComponent(component).

A component should redefine the Updateable functions inherited with custom code to define the Component functionality.

Constructor Summary

Public Constructor
public

constructor(unique: boolean)

Constructor for Base Components.

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

Called when the component is successfully added to a GameObject.

Inherited Summary

From class Updateable
public
public
public
public

id: *

public

Cleanup code for when destroying an Updateable.

public

end()

Base call function for when this Updateable is to be ended.

public

onEnd()

Called when the object is being removed or cleaned up from usage.

public

Called when the object is intended to be paused.

public

Called when the the object is first introduced.

public

Called when the object is to be unpaused from paused state.

public

Called on every update within the game, once the object has had onStart called.

public

pause()

Base call function for when this Updateable is to be paused.

public

start()

Base call function for when this Updateable is to be started.

public

Base call function for when this Updateable is to be unpaused.

public

update()

Base call function for when this Updateable is to be updated.

Public Constructors

public constructor(unique: boolean) source

Constructor for Base Components. Requires a boolean to indicate if a GameObject can contain multiple components of this type.

Override:

Updateable#constructor

Params:

NameTypeAttributeDescription
unique boolean

Is there only one of these component allowed on a GameObject?

Public Members

public className: string source

public isUnique: * source

Public Methods

public onAddComponent() source

Called when the component is successfully added to a GameObject.