Search Unity

in 2d.entities, how to convert a sprite to ecs version without using subscene?

Discussion in 'Entity Component System' started by zhoutaosheng-elex, Jul 21, 2021.

  1. zhoutaosheng-elex

    zhoutaosheng-elex

    Joined:
    Mar 31, 2021
    Posts:
    12
    in ProjectTinyExamples, it worked with subscene and converted to entities correctly. But sometimes it's not convenient to use subscene, when using ConvertToEntity, it tells me EditorRenderData should be added, and nothing is rendered

    Code (CSharp):
    1. ArgumentException: A component with type:EditorRenderData has not been added to the entity.
    2. Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.14.0-preview.18/Unity.Entities/EntityComponentStoreDebug.cs:280)