sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7.09k stars 1.11k forks source link

[Resolved]Question on “How I build games with Entitas (FNGGames)” #918

Closed wangsihao87 closed 4 years ago

wangsihao87 commented 4 years ago

Hi,

I have question on some point, as we decided to fully decouple the viewlayer, we need hide the direct refrence of Unity engine code. But as we can see, the engine use it's own data struct such like "Vector3D", "Color", in this article, we still use these define directly in component, and all the related interfaces use them too. It seems break the rules we setup before. My question is that the way to handle it?

Here's the code:

[Game, Event(EventTarget.Self)] // generates events that are bound to the entities that raise them public sealed class PositionComponent : IComponent { public Vector2D value; }

Cheers

wangsihao87 commented 4 years ago

Em, I have found the best practice in "EntitasPong Game's Open Questions", So I think I can close it.