永続的
説明
このコンポーネントは、それがアタッチされているエンティティをPersistent(永続的)としてマークします。 ルート・オブジェクトにのみ設定できる。
プロパティ
なし
機能
Get
Returns a read-only reference.
Example
ecs.Persistent.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.Persistent.set(world, component.eid, {})
Mutate
Perform an update to the component within a callback function. Return true
to indicate no changes made.
Example
ecs.Persistent.mutate(world, component.eid, (cursor) => {
return false
})
Remove
Removes the component from the entity.
Example
ecs.Persistent.remove(world, component.eid)