UnitClass
A script class that is instanced for every Unit in the game.
Kind: API page
Environments: Game
Game
A unit represents an AI controlling a Character.
The unit script only runs on the server side.
Can receive events sent with sm.event.sendToUnit.
Fields
| Name | Type | Description |
|---|---|---|
unit |
Unit | The Unit game object belonging to this class instance. |
storage |
Storage | A Storage object that can be used to store data for the next time loading this object after being unloaded. |
data |
any | Data from the "data" json element. |
params |
any | Parameter sent to sm.unit.createUnit. |