一键导入
zustand-entities
Use Zustand as a simple state store for entity management (not a true ECS).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use Zustand as a simple state store for entity management (not a true ECS).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | zustand-entities |
| description | Use Zustand as a simple state store for entity management (not a true ECS). |
Use Zustand as a simple state store for entity management.
Store entities in a Zustand store array. Systems read from the store directly (non-reactively) in useFrame, while React components subscribe to the store for re-rendering when entities are added or removed.
create()getState() in systems for non-reactive access (no re-renders)useStore(selector) in components for reactive updatesconst useWorldStore = create(() => ({
characters: [] as CharacterEntity[],
}))
// In systems (non-reactive)
useFrame(() => {
for (const char of useWorldStore.getState().characters) {
char.position.x += 0.01
}
})
// In React (reactive)
const characters = useWorldStore(s => s.characters)
return characters.map(c => <Character key={c.id} entity={c} />)
This skill is part of verekia's r3f-gamedev.
Poll for changes to any value and trigger React re-renders when it changes.
Day-to-day coding style and patterns for R3F game development with Miniplex ECS.
Verekia's preferred project setup with Next.js Pages Router, Tailwind 4, oxfmt, oxlint, and TypeScript.
Attach meshes to bones of a skinned mesh, such as attaching a sword to a character's hand.
Shake the camera when the player takes damage or on impacts for visual feedback.
Display floating damage numbers that animate upward and fade out, with support for critical hits.