Search Unity

200k dynamic animated sprites at 80fps

Discussion in 'Entity Component System' started by FabrizioSpadaro, Jun 16, 2019.

  1. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    @Opeth001 You should post that question in the Graphics section of the forum, you will probably get a better and faster answer to that.
     
    Opeth001 likes this.
  2. bog-imp

    bog-imp

    Joined:
    Jul 25, 2012
    Posts:
    43
    Hello,
    I have Issue with Delete Entities from Scene,
    so after delete entity the system still Render a Sprite from Buffer.

    SpriteSheetManager.DestroyEntity(entity, "emoji");

    Here is Simple Demo Project:

    Open: SingleSpawner

    I added component LifeTime

    public class KillBoidJobSystem : ComponentSystem
    {
    protected override void OnUpdate()
    {
    Entities.WithAllReadOnly<LifeTime>().ForEach((Entity entity, ref LifeTime lifetime) =>
    {
    if (lifetime.Value < 0)
    {
    SpriteSheetManager.DestroyEntity(entity, "emoji");
    }
    });
    }
    }


    Also Project Attached.

    And I wonder why we need in SpriteSheetRenderer.cs

    processable = GetEntityQuery(ComponentType.ReadOnly<SpriteMatrix>(), ComponentType.ReadOnly<SpriteSheetMaterial>());
     

    Attached Files:

  3. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Wow, this whole thread reads like an epic battle between Unity and a bunch of wizards. Impressive performance!