Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        public override void OnLoad()
        {
            PrefabFactory prefabFactory = new PrefabFactory(world.EntityManager);

            player = prefabFactory.Create(PrefabIds.PLAYER);
            player.GetComponent <Transform>().Position = new Vector2(250, 50);
        }
Ejemplo n.º 3
0
 public override void OnComponentAddedToEntity(ECSEntity entity, ECSComponent component)
 {
     if (component != null && component is Renderer)
     {
         AddComponent(new RenderingSystemComponent(component as Renderer, entity.GetComponent <Transform>()));
     }
 }