Skip to content

Latest commit

 

History

History
24 lines (13 loc) · 724 Bytes

File metadata and controls

24 lines (13 loc) · 724 Bytes

Behavior

A core object that modifies the behavior of a GameObject. Behaviors need an onTick method that will run every frame right before their GameObject's onTick.


Constructor

new Behavior(gameObject, enabledByDefault = true)

Initializes the behavior object, associating it with a specific scene and game object.

Arguments

  • gameObjectGameObject The game object to append this behavior to.
  • enabledByDefaultboolean Whether the behavior starts out enabled. Default: true.

Methods

onTick()

If this Behavior has an onTick method, and is part of a GameObject that is on a Layer. Every animation frame the onTick method will be executed.