File upandaway/components/staticgenerator.lua
The StaticGenerator component.
Pushes the events "upandaway_charge", "upandaway_uncharge" and "upandaway_chargechange".
Author:
Functions
Tables
Functions
- StaticGenerator:Charge ()
-
Goes to the CHARGED state.
- StaticGenerator:IsCharged ()
-
Returns whether the prefab is CHARGED.
Return value:
A boolean, representing the state.
- StaticGenerator:LongUpdate (dt)
-
Handles long updates by simply going to the UNCHARGED state.
Parameters
- StaticGenerator:OnLoad (data)
-
Loads the saved state and goes to it.
Parameters
- StaticGenerator:OnSave ()
-
Saves the current state.
- StaticGenerator:SetAverageChargedTime (dt)
-
Sets the average duration of the CHARGED state.
Parameters
-
dt: Average duration, in seconds.
- StaticGenerator:SetAverageUnchargedTime (dt)
-
Sets the average duration of the UNCHARGED state.
Parameters
-
dt: Average duration, in seconds.
- StaticGenerator:StartGenerating ()
-
Starts updating the state transition.
- StaticGenerator:StopGenerating ()
-
Halts the updating of the state transition.
- StaticGenerator:Toggle ()
-
Goes to the other state.
- StaticGenerator:Uncharge ()
-
Goes to the UNCHARGED state.
Tables
- StaticGenerator
- The StaticGenerator component.
Pushes the events "upandaway_charge", "upandaway_uncharge" and "upandaway_chargechange".