Entity

Members

Functions

addTag
void addTag(int tag)
attach
void attach(Entity entity)

Makes the passed entity a child of this entity

attach
void attach(Collider2D collider)
attach
void attach(AudioSource source)
attach
void attach(Renderable renderable)
detach
void detach(Entity entity)

Detach a child entity or the parent entity

detach
void detach(Collider2D collider)
detach
void detach(AudioSource source)
detach
void detach(Renderable renderable)
draw
void draw(RenderTarget renderTarget, Matrix transform)

Called every draw tick (skipped if update loop is behind)

getLocalTransformMatrix
Matrix getLocalTransformMatrix()
getScreenPosition
Vector2 getScreenPosition()
getWorldPosition
Vector3 getWorldPosition()
getWorldRotation
Quaternion getWorldRotation()
getWorldScale
Vector3 getWorldScale()
getWorldTransformMatrix
Matrix getWorldTransformMatrix()
hasTag
bool hasTag(int tag)
lookAt
void lookAt(Entity entity)
lookAt
void lookAt(Vector3 position)
onCollision2D
void onCollision2D(Collider2D collider, Collider2D other)
onCollisionEnter2D
void onCollisionEnter2D(Collider2D collider, Collider2D other)
onCollisionExit2D
void onCollisionExit2D(Collider2D collider, Collider2D other)
removeTag
void removeTag(int tag)
setup
void setup()

Called when first attached to a scene

start
void start()

Called when attached to a scene

update
void update()

Called every update tick

Properties

game
Game game [@property getter]

Shortcut for scene.game

input
Input input [@property getter]

Shortcut for scene.game.input

parent
Entity parent [@property getter]
parent
Entity parent [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
scene
Scene scene [@property getter]

Variables

_scene
Scene _scene;
Undocumented in source.
audioSources
AudioSource[] audioSources;
Undocumented in source.
children
Entity[] children;
Undocumented in source.
colliders2d
Collider2D[] colliders2d;
Undocumented in source.
friction
float friction;

Velocity is multiplied by (1 - friction) every tick

isSetup
bool isSetup;
Undocumented in source.
position
Vector3 position;
rotation
Quaternion rotation;
scale
Vector3 scale;
velocity
Vector3 velocity;

Meta