-
Notifications
You must be signed in to change notification settings - Fork 0
System
RedRimmedBox edited this page Apr 14, 2025
·
7 revisions
A System is defined as a pure function.
func yourSystem(
commands: Commands,
position: Query2<Entity, Position>,
love: Query3<Heart, Memories, Trust>
) {
// Your wonderful logic here
}
Then, simply connect this function to the World. Once connected, it will automatically run whenever World/update(_:) is called!
let world = World()
.addSystem(.update, yourSystem(commands:position:love:))
world.setupWorld()
world.update(-1) // first frame (start up)
world.update(0) // 💕
world.update(1) // 💕
...
現在 wiki は ecs-swift v0.2 に対応しています。