Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug 2D Entities Sprite Renderer doesn't work

Discussion in 'Graphics for ECS' started by aganm, Oct 29, 2020.

  1. aganm

    aganm

    Joined:
    Sep 25, 2019
    Posts:
    114
    I create a new 2d project in Unity 2020.1.

    I import com.unity.entities, com.unity.2d.entities, com.unity.rendering.hybrid

    I add a Sprite object to my scene which has a Sprite Renderer component.

    I add a ConvertToEntity script to it.

    I click Play.

    I have this error:

    ArgumentException: A component with type:EditorRenderData has not been added to the entity.
    Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/EntityComponentStoreDebug.cs:280)
    Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, System.Int32 componentType) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/EntityComponentStoreDebug.cs:286)
    Unity.Entities.EntityDataAccess.GetSharedComponentData[T] (Unity.Entities.Entity entity, Unity.Entities.ManagedComponentStore managedComponentStore) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/EntityDataAccess.cs:993)
    Unity.Entities.EntityManager.GetSharedComponentData[T] (Unity.Entities.Entity entity) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/EntityManagerAccessComponentData.cs:217)
    Unity.U2D.Entities.SpriteRendererHybridRendering+<>c__DisplayClass_OnUpdate_LambdaJob0.OriginalLambdaBody (Unity.Entities.Entity e, System.Int32 entityInQueryIndex, Unity.U2D.Entities.Renderer2D& renderer2D, Unity.U2D.Entities.SpriteRenderer& spriteRenderer, Unity.Transforms.LocalToWorld& localToWorld) (at Library/PackageCache/com.unity.2d.entities@0.29.0-preview.3/SpriteRenderer/Unity.2D.Entities.SpriteRenderer.Hybrid/SpriteRendererHybridRendering.cs:58)
    Unity.U2D.Entities.SpriteRendererHybridRendering+<>c__DisplayClass_OnUpdate_LambdaJob0.IterateEntities (Unity.Entities.ArchetypeChunk& chunk, Unity.U2D.Entities.SpriteRendererHybridRendering+<>c__DisplayClass_OnUpdate_LambdaJob0+LambdaParameterValueProviders+Runtimes& runtimes) (at <f0049375208a47caa1f6b7336c6d3954>:0)
    Unity.U2D.Entities.SpriteRendererHybridRendering+<>c__DisplayClass_OnUpdate_LambdaJob0.Execute (Unity.Entities.ArchetypeChunk chunk, System.Int32 chunkIndex, System.Int32 firstEntityIndex) (at <f0049375208a47caa1f6b7336c6d3954>:0)
    Unity.Entities.JobChunkExtensions.RunWithoutJobs[T] (T& jobData, Unity.Entities.ArchetypeChunkIterator& chunkIterator) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/IJobChunk.cs:182)
    Unity.U2D.Entities.SpriteRendererHybridRendering+<>c__DisplayClass_OnUpdate_LambdaJob0.RunWithoutJobSystem (Unity.Entities.ArchetypeChunkIterator* archetypeChunkIterator, System.Void* jobData) (at <f0049375208a47caa1f6b7336c6d3954>:0)
    Unity.Entities.InternalCompilerInterface.RunJobChunk[T] (T& jobData, Unity.Entities.EntityQuery query, Unity.Entities.InternalCompilerInterface+JobChunkRunWithoutJobSystemDelegate functionPointer) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/CodeGeneratedJobForEach/LambdaJobDescription.cs:380)
    Unity.U2D.Entities.SpriteRendererHybridRendering.OnUpdate () (at Library/PackageCache/com.unity.2d.entities@0.29.0-preview.3/SpriteRenderer/Unity.2D.Entities.SpriteRenderer.Hybrid/SpriteRendererHybridRendering.cs:45)
    Unity.Entities.SystemBase.Update () (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/SystemBase.cs:411)
    Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/ComponentSystemGroup.cs:513)
    UnityEngine.Debug:LogException(Exception)
    Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/Stubs/Unity/Debug.cs:19)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/ComponentSystemGroup.cs:518)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/ComponentSystemGroup.cs:461)
    Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/ComponentSystem.cs:107)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.14.0-preview.19/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)
     
    Last edited: Oct 29, 2020
  2. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    aganm likes this.