载入中...
搜索中...
未找到
eve::ScriptComponentInstanceState结构体 参考

一个脚本实体实例上某个组件的**当前状态**(供引擎工具读取)。 更多...

#include <ScriptComponentSnapshot.h>

Public 属性

std::uint64_t entityId = 0
 脚本 VM 内的实体 id(实例上的 _eid)。
 
std::string name
 组件名(脚本登记时给的)。
 
SchemaVersion version
 组件版本。
 
Generation generation
 注册表里的代际(同名同版本每次重新登记 +1)。
 
Value::Object fields
 字段名 → 当前值,按注册表记录的**声明顺序**收集( inspector 需要稳定顺序)。
 

详细描述

一个脚本实体实例上某个组件的**当前状态**(供引擎工具读取)。

备注
这是 J-3「编辑器/工具读到脚本组件」的读侧原语:字段来自引擎侧那一个权威存储, 不是脚本实例的槽位。**未登记**的组件(纯槽位语义)不出现在这里——它们没有名字与 版本,引擎工具无从寻址(§9.62.1 的成本策略)。

在文件 ScriptComponentSnapshot.h 第 38 行定义.

类成员变量说明

◆ entityId

std::uint64_t eve::ScriptComponentInstanceState::entityId = 0

脚本 VM 内的实体 id(实例上的 _eid)。

这是引擎侧存储的键的第一段,因此也是"按状态找到那份数据"的唯一途径:编辑器要写回字段 必须先有它(ScriptComponentStoreKey 就是 (实体, 组件名, 版本))。

在文件 ScriptComponentSnapshot.h 第 45 行定义.

被这些函数引用 eve::scriptComponentInstancesOf().

◆ fields

Value::Object eve::ScriptComponentInstanceState::fields

字段名 → 当前值,按注册表记录的**声明顺序**收集( inspector 需要稳定顺序)。

在文件 ScriptComponentSnapshot.h 第 53 行定义.

◆ generation

Generation eve::ScriptComponentInstanceState::generation

注册表里的代际(同名同版本每次重新登记 +1)。

在文件 ScriptComponentSnapshot.h 第 51 行定义.

◆ name

std::string eve::ScriptComponentInstanceState::name

组件名(脚本登记时给的)。

在文件 ScriptComponentSnapshot.h 第 47 行定义.

◆ version

SchemaVersion eve::ScriptComponentInstanceState::version

组件版本。

在文件 ScriptComponentSnapshot.h 第 49 行定义.


该结构体的文档由以下文件生成: