public override void OnEntityRemoved(ECSEntity entity) { Transform transform = entity.GetComponent <Transform>(); Renderer renderer = entity.GetComponent <Renderer>(); RenderingSystemComponent renderingSystemComponent = FindComponent(transform, renderer); if (renderingSystemComponent != null) { RemoveComponent(renderingSystemComponent); } }
public override void OnLoad() { PrefabFactory prefabFactory = new PrefabFactory(world.EntityManager); player = prefabFactory.Create(PrefabIds.PLAYER); player.GetComponent <Transform>().Position = new Vector2(250, 50); }
public override void OnComponentAddedToEntity(ECSEntity entity, ECSComponent component) { if (component != null && component is Renderer) { AddComponent(new RenderingSystemComponent(component as Renderer, entity.GetComponent <Transform>())); } }