public Entity(IScene scene, Vector2 position, Vector2 size, bool isGameObject) { Scene = scene; scene?.AddEntity(this); Position = position; Size = size; children = new List <IEntity>(); components = new Dictionary <Type, IComponent>(); if (isGameObject) { scene?.ServiceProvider.GetService <IGameObjectService>().AddEntity(this); } }