Enfusion Script API
|
Public Member Functions | |
proto external bool | IsPreviewingState () |
Check if we are previewing a transition. | |
proto external bool | IsPreviewingDateTime () |
proto external bool | IsPreviewingWind () |
proto external bool | SetStatePreview (bool preview, string stateName="") |
Previews state locally (without network syncing). | |
proto external bool | SetDateTimePreview (bool preview, int year=-1, int month=-1, int day=-1, float timeOfTheDay01=-1) |
Previews date and time of the day locally (without network syncing). | |
proto external bool | SetWindPreview (bool preview, float windSpeed=-1, float windAngleDegrees=-1) |
proto external WeatherTransitionRequestResponse | RequestStateTransitionImmediately (WeatherStateTransitionNode node) |
Requests an immediate transition. | |
proto external WeatherTransitionRequestResponse | RequestStateTransition () |
Requests next state transition from the state transition node queue. | |
proto external ref WeatherStateTransitionNode | CreateStateTransition (string stateName, float transitionDurationHours, float stateDurationHours) |
proto external bool | EnqueueStateTransition (WeatherStateTransitionNode transition, bool checkValidity) |
Adds a new state transition to the state transition queue. | |
proto external bool | InsertStateTransition (int index, WeatherStateTransitionNode transition, bool checkValidity) |
Inserts a state transition to the state transition queue. | |
proto external void | GetStateTransitionNodeList (out notnull array< ref WeatherStateTransitionNode > outArr) |
Retrieves state transition node list. | |
proto external WeatherStateTransitionNode | GetStateTransitionNode (int index) |
proto external WeatherStateTransitionNode | GetCurrentStateTransitionNode () |
proto external WeatherState | GetCurrentState () |
proto external WeatherState | GetNextState () |
proto external float | GetTimeLeftUntilNextState () |
Retrieves in-game remaining time until next state is completely set. | |
proto external float | GetTimeLeftUntilNextVariant () |
Retrieves in-game remaining time until next state's variant is completely set. | |
proto external bool | RemoveStateTransition (int index, bool removeInvalidTransitions, out int totalRemoved) |
Removes state transition node at supplied index. | |
proto external int | GetStateTransitionsCount () |
Get total number of state transitions. | |
proto external bool | CheckValidStateTransition (int stateIndexFrom, int stateIndexTo) |
proto external void | AddTransitionCallbacks (BaseWeatherTransitionCallbacks callbacks) |
proto external void | RemoveTransitionCallbacks (BaseWeatherTransitionCallbacks callbacks) |
proto external void BaseWeatherStateTransitionManager.AddTransitionCallbacks | ( | BaseWeatherTransitionCallbacks | callbacks | ) |
proto external bool BaseWeatherStateTransitionManager.CheckValidStateTransition | ( | int | stateIndexFrom, |
int | stateIndexTo | ||
) |
proto external ref WeatherStateTransitionNode BaseWeatherStateTransitionManager.CreateStateTransition | ( | string | stateName, |
float | transitionDurationHours, | ||
float | stateDurationHours | ||
) |
proto external bool BaseWeatherStateTransitionManager.EnqueueStateTransition | ( | WeatherStateTransitionNode | transition, |
bool | checkValidity | ||
) |
Adds a new state transition to the state transition queue.
Keep in mind that state transition node cannot be inserted to the first node if a transition is already on course. Can only be called by the authority (server, singleplayer...).
transition | Transition object to enqueue |
checkValidity | If true, it will only accept valid transitions (transition must be compatible with previous node) |
proto external WeatherState BaseWeatherStateTransitionManager.GetCurrentState | ( | ) |
proto external WeatherStateTransitionNode BaseWeatherStateTransitionManager.GetCurrentStateTransitionNode | ( | ) |
proto external WeatherState BaseWeatherStateTransitionManager.GetNextState | ( | ) |
proto external WeatherStateTransitionNode BaseWeatherStateTransitionManager.GetStateTransitionNode | ( | int | index | ) |
proto external void BaseWeatherStateTransitionManager.GetStateTransitionNodeList | ( | out notnull array< ref WeatherStateTransitionNode > | outArr | ) |
Retrieves state transition node list.
proto external int BaseWeatherStateTransitionManager.GetStateTransitionsCount | ( | ) |
Get total number of state transitions.
proto external float BaseWeatherStateTransitionManager.GetTimeLeftUntilNextState | ( | ) |
Retrieves in-game remaining time until next state is completely set.
proto external float BaseWeatherStateTransitionManager.GetTimeLeftUntilNextVariant | ( | ) |
Retrieves in-game remaining time until next state's variant is completely set.
proto external bool BaseWeatherStateTransitionManager.InsertStateTransition | ( | int | index, |
WeatherStateTransitionNode | transition, | ||
bool | checkValidity | ||
) |
Inserts a state transition to the state transition queue.
Keep in mind that state transition node cannot be inserted to the first node if a transition is already on course. Can only be called by the authority (server, singleplayer...).
index | Correct index, from 0 to length |
transition | Transition node |
checkValidity | If true, it will only accept valid transitions (transition must be compatible with previous and next nodes) |
proto external bool BaseWeatherStateTransitionManager.IsPreviewingDateTime | ( | ) |
proto external bool BaseWeatherStateTransitionManager.IsPreviewingState | ( | ) |
Check if we are previewing a transition.
proto external bool BaseWeatherStateTransitionManager.IsPreviewingWind | ( | ) |
proto external bool BaseWeatherStateTransitionManager.RemoveStateTransition | ( | int | index, |
bool | removeInvalidTransitions, | ||
out int | totalRemoved | ||
) |
Removes state transition node at supplied index.
Can only be called by the authority (server, singleplayer...).
index | Index of node which will be deleted. |
removeInvalidTransitions | Perform a sanity check and remove any transition nodes which arent compatible after deleting the selected one. |
totalRemoved | how many nodes were removed, this will be 0 if supplied index is invalid or caller is not master. 1 if index is valid and removeInvalidTransitions == false, N if index is valid and removeInvalidTransitions == true |
proto external void BaseWeatherStateTransitionManager.RemoveTransitionCallbacks | ( | BaseWeatherTransitionCallbacks | callbacks | ) |
proto external WeatherTransitionRequestResponse BaseWeatherStateTransitionManager.RequestStateTransition | ( | ) |
Requests next state transition from the state transition node queue.
This will start transitioning smoothly according to transition duration. Cannot be called if a transition is already on course.
proto external WeatherTransitionRequestResponse BaseWeatherStateTransitionManager.RequestStateTransitionImmediately | ( | WeatherStateTransitionNode | node | ) |
Requests an immediate transition.
node | The transition node we want to transition to, it must be a valid node within the state transition queue |
proto external bool BaseWeatherStateTransitionManager.SetDateTimePreview | ( | bool | preview, |
int | year = -1 , |
||
int | month = -1 , |
||
int | day = -1 , |
||
float | timeOfTheDay01 = -1 |
||
) |
Previews date and time of the day locally (without network syncing).
preview | Enables or disables the preview |
proto external bool BaseWeatherStateTransitionManager.SetStatePreview | ( | bool | preview, |
string | stateName = "" |
||
) |
Previews state locally (without network syncing).
It is not required that the state is part of the state transition queue. I.e. you can preview nodes without inserting them.
preview | Enables or disables the preview |
stateName | The state to preview |
proto external bool BaseWeatherStateTransitionManager.SetWindPreview | ( | bool | preview, |
float | windSpeed = -1 , |
||
float | windAngleDegrees = -1 |
||
) |