Unity3D 样式的 Ubpa 实体-组件-系统 (U ECS)
__ __ _______ ______ _______.
| | | | | ____| / | / |
| | | | | |__ | ,----' | (----`
| | | | | __| | | \ \
| `--' | | |____ | `----.----) |
\______/ |_______| \______|_______/
⭐ Star us on GitHub — it helps!
Ubpa Entity-Component-System in Unity3D-style
Tested platforms:
Windows 10: VS2019 16.8.5
Ubuntu 20: GCC 10.2, Clang 11.0
MacOS 11.0 : GCC 10.2
AppleClang 12 and Clang 11 is not supported
#include
using namespace Ubpa::UECS;
struct Position { float val; };
struct Velocity { float val; };
struct MoverSystem {
static void OnUpdate(Schedule& schedule) {
schedule.RegisterEntityJob(
[](const Velocity* v, Position* p) {
p->val += v->val;
},
"Mover"
);
}
};
int main() {
World w;
w.entityMngr.cmptTraits.Register();
w.systemMngr.RegisterAndActivate();
w.entityMngr.Create(Ubpa::TypeIDs_of);
w.Update();
}other examples
Entity You can copy and paste the license summary from below.
…暂无开放 Issues,或尚未同步最近议题。