protected override void OnUpdate()
        {
#if UNITY_EDITOR
            // Added since the systems might run while the editor is compiling
            if (UnityEditor.EditorApplication.isCompiling)
            {
                return;
            }
#endif //UNITY_EDITOR

            CommonHybridUtils.ClearSpriteRendererGroup();

            var entityCount = m_RendererQuery.CalculateEntityCount();
            var renderers   = new NativeList <HybridRendererInfo>(entityCount, Allocator.TempJob);

            Entities
            .WithoutBurst()
            .ForEach((Entity e,
                      int entityInQueryIndex,
                      in Renderer2D renderer2D,
                      in SpriteRenderer spriteRenderer,
                      in LocalToWorld localToWorld) =>
            {
                if (!SpriteRendererUtils.IsValidSpriteRenderer(spriteRenderer))
                {
                    return;
                }
                if (!SpriteRendererHybridUtils.IsValidHybridSpriteRenderer(EntityManager, spriteRenderer))
                {
                    return;
                }
#if UNITY_EDITOR
                var editorRenderData = EntityManager.GetSharedComponentData <EditorRenderData>(e);
#endif //UNITY_EDITOR

                var materialData = EntityManager.GetSharedComponentData <Material2DProxy>(spriteRenderer.Material);
                var spriteProxy  = EntityManager.GetSharedComponentData <SpriteProxy>(spriteRenderer.Sprite);

                renderers.Add(new HybridRendererInfo
                {
                    SpriteID   = spriteProxy.Sprite.GetInstanceID(),
                    TextureID  = spriteProxy.Sprite.texture.GetInstanceID(),
                    MaterialID = materialData.Material.GetInstanceID(),

                    Color     = spriteRenderer.Color,
                    Transform = localToWorld.Value,
                    Bounds    = renderer2D.Bounds,

                    Layer        = renderer2D.RenderingLayer,
                    SortingLayer = renderer2D.SortingLayer,
                    SortingOrder = renderer2D.OrderInLayer,
#if UNITY_EDITOR
                    SceneCullingMask = editorRenderData.SceneCullingMask,
#endif //UNITY_EDITOR

                    ShaderChannelMask = k_SpriteChannelMask
                });
            }).Run();
        static OnExitClear()
        {
            UnityEditor.EditorApplication.playModeStateChanged += change =>
            {
                if (change == UnityEditor.PlayModeStateChange.ExitingPlayMode ||
                    change == UnityEditor.PlayModeStateChange.EnteredEditMode)
                {
                    CommonHybridUtils.ClearSpriteRendererGroup();
                }
            };

            UnityEditor.SceneManagement.EditorSceneManager.sceneOpening += OnSceneOpening;
            UnityEditor.SceneManagement.EditorSceneManager.sceneClosing += OnSceneClosing;
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged;
        }
 private static void OnSceneChanged(Scene a, Scene b)
 {
     CommonHybridUtils.ClearSpriteRendererGroup();
 }
 private static void OnSceneClosing(Scene scene, bool close)
 {
     CommonHybridUtils.ClearSpriteRendererGroup();
 }
 private static void OnSceneOpening(string path, UnityEditor.SceneManagement.OpenSceneMode mode)
 {
     CommonHybridUtils.ClearSpriteRendererGroup();
 }