Are Unity scripts the same as systems in an ECS?
Are Unity scripts the same as systems in an ECS?
I am working on making a very simple 2D game engine, and I am in the stages of redoing my entities to work somewhat like Unitys system. I have been doing research on how ECS works, and I am beginning to understand it better.
As I understand, a component only holds data and literally cannot do anything but hold that data. On the other hand, systems are used to act on that data.
My question is if the scripts that are attached to a GameObjcet in Unity are technically systems and not components as they are called in the editor?
I am coding in Java, so if anyone has any examples of an ECS system implemented in Java or C#, that would be great as most of the examples I have seen were in C++ which is a bit more difficult for me to understand. Thanks!
1 Answer
1
Unity doesn't strictly work via an ECS, despite using the term "Component." A Unity component, in the form of a MonoBehaviour
, can have both data and system logic. Unity will, in future versions, be rolling out an ECS model.
MonoBehaviour
If you'd like to use current Unity versions (2018.1 and below) and strictly adhere to an ECS methodology, I'd suggest looking into Entitas and their Unity Plugin. You can also choose to structure your code, assets, and scenes to conform to ECS principles but Entitas is very efficient and solves a lot of problems for you.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment