Class Behavior
Represents a Component that has just logic, updatable through the Update()
method.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework
Assembly: Evergine.Framework.dll
Syntax
public abstract class Behavior : Component, IDependencyObject
Constructors
Behavior()
Initializes a new instance of the Behavior class.
Declaration
protected Behavior()
Behavior(FamilyType)
Initializes a new instance of the Behavior class.
Declaration
protected Behavior(FamilyType family)
Parameters
Type | Name | Description |
---|---|---|
Family |
family | The family. |
Properties
Family
Gets or sets the FamilyFamily
set to Default
.
Default behaviors are updated first, and any other behaviors with different FamilyDefault
are updated in parallel
(the list of Behavior of each Family
Declaration
public FamilyType Family { get; protected set; }
Property Value
Type | Description |
---|---|
Family |
UpdateOrder
Gets or sets the update order. Behaviors are sorted according to this value in ascending order, so behaviors with lower values will be updated before behaviors with higher values.
Declaration
[RenderProperty(Tooltip = "Behaviors are sorted according to this value in ascending order, so behaviors with lower values will be updated before behaviors with higher values")]
public float UpdateOrder { get; set; }
Property Value
Type | Description |
---|---|
float | The update order. |
Methods
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
Update(TimeSpan)
Allows this instance to execute custom logic during its Update
.
Declaration
protected abstract void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
Time |
gameTime | The game time. |