PackagePBLabs.Engine.Components
Classpublic class TickedComponent
InheritanceTickedComponent Inheritance EntityComponent
ImplementsITickedObject
SubclassesSimpleSpatialComponent

Base class for components that need to perform actions every tick. This needs to be subclassed to be useful.



Public Properties
 PropertyDefined by
 InheritedIsRegistered : Boolean
Whether or not the component is currently registered with an entity.
EntityComponent
 InheritedName : String
The name given to the component when it is added to an entity.
EntityComponent
 InheritedOwner : IEntity
A reference to the entity that this component currently belongs to.
EntityComponent
  RegisterForTicks : Boolean = true
Do we actually want to register for ticks? Useful if a subclass wants to disable the functionality.
TickedComponent
  UpdatePriority : Number = 0.0
The update priority for this component.
TickedComponent
Public Methods
 MethodDefined by
  
OnInterpolateTick(factor:Number):void
This method is called every frame by the ProcessManager on any objects that have been added to it with the AddTickedObject method.
TickedComponent
  
OnTick(tickRate:Number):void
This method is called every tick by the ProcessManager on any objects that have been added to it with the AddTickedObject method.
TickedComponent
 Inherited
Register(owner:IEntity, name:String):void
Registers the component with an entity.
EntityComponent
 Inherited
Reset():void
This is called by an entity on all of its components any time a component is added or removed.
EntityComponent
 Inherited
Unregister():void
Unregisters the component from an entity.
EntityComponent
Protected Methods
 MethodDefined by
  
_OnAdd():void
TickedComponent
  
_OnRemove():void
TickedComponent
 Inherited
_OnReset():void
This is called anytime a component is added or removed from the owner entity.
EntityComponent
Property detail
RegisterForTicksproperty
public var RegisterForTicks:Boolean = true

Do we actually want to register for ticks? Useful if a subclass wants to disable the functionality. Only checked at _OnAdd/_OnRemove time.

UpdatePriorityproperty 
public var UpdatePriority:Number = 0.0

The update priority for this component. Higher numbered priorities have OnInterpolateTick and OnTick called before lower priorities.

Method detail
_OnAdd()method
protected override function _OnAdd():void
_OnRemove()method 
protected override function _OnRemove():void
OnInterpolateTick()method 
public function OnInterpolateTick(factor:Number):void

This method is called every frame by the ProcessManager on any objects that have been added to it with the AddTickedObject method.

This method should be used to interpolate data between its state on the previous tick and its state on the upcoming tick.

Parameters
factor:Number — This is a number between 0 and 1 with 0 representing the previous tick and 1 representing the next tick. In other words, it is the percentage of time between ticks the current frame is.
OnTick()method 
public function OnTick(tickRate:Number):void

This method is called every tick by the ProcessManager on any objects that have been added to it with the AddTickedObject method.

Parameters
tickRate:Number — The amount of time (in seconds) specified for a tick.