System in ECS
-
Hi!
Since Orillusion uses a Data-Oriented Design & ECS architecture, I wondered if there is any documentation on creating your own Systems.
for example if I create a custom script/component called
Health
and another calledAttack
; how would I query the entities containing these components? -
orillusion 不是严格的 ecs 架构,弱化了 system 的概念,将 system 基本一起放在了 component 里
对于查找 Component,可以参考 object 的相关 API,比如 getComponentsInChild 可以查找一个节点中所有目标 Component
// get all MeshRenderer components in obj let meshList = obj.getComponentsInChild(MeshRenderer)
类似,可以通过遍历 scene 找到所有目标 components
// get all attack components in scene let attaclist = scene.getComponentsInChild(Attack)