元编程参考文档

状态机状态

8 个节点

本页内容 8

状态机状态

函数

此节点没有文档说明。

签名
状态机状态() -> State Machine State
StateMachineState StateMachineState()

返回

状态机状态State Machine State
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
状态机状态
所属包
状态机宿主

所属状态机

函数

The machine this instance is running in. Set by the runtime when the state is constructed; null
only for an instance constructed outside a machine run.

签名
所属状态机(State Machine State: State Machine State) -> State Machine
StateMachineApplication Machine(StateMachineState State Machine State)

参数

名称类型默认值说明
State Machine StateState Machine State—

返回

结果State Machine
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
状态机状态
所属包
状态机宿主

更新频率

函数

How often the machine ticks this state's Update, in HERTZ (ticks per second). Default 60.
Settable at any time - the loop re-reads it every iteration - though "set it during Enter" is the
documented idiom. Values that are not positive finite numbers are read as the 60 Hz default.

签名
更新频率(State Machine State: State Machine State) -> 数字
double UpdateFrequency(StateMachineState State Machine State)

参数

名称类型默认值说明
State Machine StateState Machine State—

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
状态机状态
所属包
状态机宿主

设置更新频率

函数

Sets how often this state's Update ticks, in hertz. The loop re-reads the frequency every tick, so
the change takes effect from the next tick on.

签名
设置更新频率
    State Machine State: State Machine State
    赫兹: 数字
void SetUpdateFrequency(
    StateMachineState State Machine State,
    double hertz)

参数

名称类型默认值说明
State Machine StateState Machine State—
赫兹数字—Ticks per second.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
状态机状态
所属包
状态机宿主

停止

函数

Ends the machine: the loop stops after the callback that called this returns. No further state is
entered and the active state is not exited - stopping is an end, not a transition.

签名
停止(State Machine State: State Machine State)
void Stop(StateMachineState State Machine State)

参数

名称类型默认值说明
State Machine StateState Machine State—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
状态机状态
所属包
状态机宿主

进入

事件

The state has just been entered. Runs once per entry, on a freshly constructed instance - a
self-transition exits, constructs anew, and enters again, so nothing survives from the previous
visit. The documented place to set StateMachineState.UpdateFrequency.

签名
进入()
void Enter()
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 状态机状态
声明于
状态机状态
所属包
状态机宿主

退出

事件

A transition is leaving this state. Runs as part of a transition only - a machine that ends (a
final state's Update returned, or StateMachineState.Stop was called) does not exit its active state,
because ending is not leaving to anywhere. See the loop for the full sequence.

签名
退出()
void Exit()
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 状态机状态
声明于
状态机状态
所属包
状态机宿主

更新

事件

One tick of the active state, at the state's StateMachineState.UpdateFrequency.

签名
更新(增量: 数字)
void Update(double delta)

参数

名称类型默认值说明
增量数字—Time this tick stands for, in SECONDS - at frequency f this is 1/f. The loop is fixed-rate, so the delta is the tick duration rather than a wall-clock measurement.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 状态机状态
声明于
状态机状态
所属包
状态机宿主