RtUnitBhv
The RtUnitBhv is the most central component in TBE. The design is such that it is meant to be observed for state changes and those changes can be reacted upon.
If a GameObject has this Behaviour, then on the Start Event, the RtUnitBhv gets initialized from the Base Data (UnitBase). For that to happen, you have to specify from which UnitBase it should be initialized.
RtUnitBhvs know their owning Player.
Initializing a Unit
every runtime unit must be initialized from a UnitBase
Initializing a Unit in the Editor (Scene)
To initialize a Unit you must provide one of "Unit Base" or "Unit Base Name".
See also Data resiliency against future breaking changes when you decide which one to use. In short: If you want to test something out, you can use the reference. If you get serious, use the name.
Initializing a Unit programmatically
Unit Prefab
| It is possible and a powerful feature that you can use one unit prefab with different (instances of) UnitBase data. |
Runtime Unit Data
The Runtime Unit holds the following data:
-
damage queue (last received damage).
-
this is used on Unit death for finding out which unit delivered "the killing blow".
-
-
Base (stats after Attributes, but before Buffs)
-
Final (stats after Bufffs)
-
dynamics (this has no public API. It regenerates life, shield and energy numbers)
-
private outline (the outline, if any)
-
IsDead
-
attributes
-
buffs
-
abilities
-
remember that inventories are abilities
-
-
veterancies
-
this is a wrapper for multiple veterancies, but currently there can be only one per unit.
-
-
weapons
-
this is a wrapper for multiple weapons, but currently there can be only one per unit.
-
-
motionMapper (this has no default implementation. See Animator and Animations)
-
CurrentVitals
-
createdUnits (keeps track of Units this unit has created)
-
DisplayName
-
Player