Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug TargetException: in entities.graphics

Discussion in 'Graphics for ECS' started by taabox, Apr 28, 2023.

  1. taabox

    taabox

    Joined:
    Feb 6, 2017
    Posts:
    4
    Using Unity 2022.2.16 version.
    I have created a 2D URP project.
    I installed "com.unity.entities" and "com.unity.entities.graphics" from the package manager.
    Create a new scene and create a subscene within it.
    When I play it in the editor I get the error message and warning below.
    What could be the cause?
    Thank you in advance.
    ----------------------------------------------------------------------------------
    TargetException: Non-static field requires a target
    System.Reflection.RuntimeFieldInfo.GetValue (System.Object obj) (at <cbc72d4a9767498db39486e941a498e3>:0)
    Unity.Rendering.EntitiesGraphicsSystem.ValidateUsingURPForwardPlus () (at ./Library/PackageCache/com.unity.entities.graphics@1.0.0-pre.65/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:752)
    Unity.Rendering.EntitiesGraphicsSystem.OnCreate () (at ./Library/PackageCache/com.unity.entities.graphics@1.0.0-pre.65/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:817)
    Unity.Entities.ComponentSystemBase.CreateInstance (Unity.Entities.World world) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemBase.cs:221)
    Unity.Entities.World.AddSystem_OnCreate_Internal (Unity.Entities.ComponentSystemBase system) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/World.cs:467)
    Unity.Entities.World.GetOrCreateSystemsAndLogException (System.Collections.Generic.IEnumerable`1[T] types, System.Int32 typesCount, Unity.Collections.AllocatorManager+AllocatorHandle allocator) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/World.cs:1150)
    UnityEngine.Debug:LogException(Exception)
    Unity.Debug:LogException(Exception) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/Stubs/Unity/Debug.cs:19)
    Unity.Entities.World:GetOrCreateSystemsAndLogException(IEnumerable`1, Int32, AllocatorHandle) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/World.cs:1156)
    Unity.Entities.World:GetOrCreateSystemsAndLogException(Type[], AllocatorHandle) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/World.cs:1182)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, ComponentSystemGroup, DefaultRootGroups) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:235)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:274)
    Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:154)
    Unity.Entities.DefaultWorldInitialization:DefaultLazyEditModeInitialize() (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:341)
    Unity.Scenes.SubScene:OnEnable() (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Scenes/SubScene.cs:318)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
    ----------------------------------------------------------------------------------
    Ignoring invalid [Unity.Entities.UpdateBeforeAttribute] attribute on Unity.Rendering.DeformationsInPresentation targeting Unity.Rendering.EntitiesGraphicsSystem.
    This attribute can only order systems that are members of the same ComponentSystemGroup instance.
    Make sure that both systems are in the same system group with [UpdateInGroup(typeof(Unity.Entities.PresentationSystemGroup))],
    or by manually adding both systems to the same group's update list.
    UnityEngine.Debug:LogWarning (object)
    Unity.Debug:LogWarning (object) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/Stubs/Unity/Debug.cs:15)
    Unity.Entities.ComponentSystemSorter:WarnAboutAnySystemAttributeBadness (int,Unity.Entities.ComponentSystemGroup) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemSorter.cs:461)
    Unity.Entities.ComponentSystemGroup:GenerateMasterUpdateList () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:451)
    Unity.Entities.ComponentSystemGroup:RecurseUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:372)
    Unity.Entities.ComponentSystemGroup:SortSystems () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:559)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal (Unity.Entities.World,System.Collections.Generic.IEnumerable`1<System.Type>) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:279)
    Unity.Entities.DefaultWorldInitialization:Initialize (string,bool) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:154)
    Unity.Entities.DefaultWorldInitialization:DefaultLazyEditModeInitialize () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:341)
    Unity.Scenes.SubScene:OnEnable () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Scenes/SubScene.cs:318)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    ----------------------------------------------------------------------------------
    Ignoring invalid [Unity.Entities.UpdateBeforeAttribute] attribute on Unity.Rendering.RegisterMaterialsAndMeshesSystem targeting Unity.Rendering.EntitiesGraphicsSystem.
    This attribute can only order systems that are members of the same ComponentSystemGroup instance.
    Make sure that both systems are in the same system group with [UpdateInGroup(typeof(Unity.Entities.PresentationSystemGroup))],
    or by manually adding both systems to the same group's update list.
    UnityEngine.Debug:LogWarning (object)
    Unity.Debug:LogWarning (object) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/Stubs/Unity/Debug.cs:15)
    Unity.Entities.ComponentSystemSorter:WarnAboutAnySystemAttributeBadness (int,Unity.Entities.ComponentSystemGroup) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemSorter.cs:461)
    Unity.Entities.ComponentSystemGroup:GenerateMasterUpdateList () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:451)
    Unity.Entities.ComponentSystemGroup:RecurseUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:372)
    Unity.Entities.ComponentSystemGroup:SortSystems () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:559)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal (Unity.Entities.World,System.Collections.Generic.IEnumerable`1<System.Type>) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:279)
    Unity.Entities.DefaultWorldInitialization:Initialize (string,bool) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:154)
    Unity.Entities.DefaultWorldInitialization: DefaultLazyEditModeInitialize () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:341)
    Unity.Scenes.SubScene:OnEnable () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Scenes/SubScene.cs:318)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
    ----------------------------------------------------------------------------------
    Ignoring invalid [Unity.Entities.CreateAfterAttribute] attribute on Unity.Rendering.RegisterMaterialsAndMeshesSystem targeting Unity.Rendering.EntitiesGraphicsSystem.
    This attribute can only order systems that are members of the same ComponentSystemGroup instance.
    Make sure that both systems are in the same system group with [UpdateInGroup(typeof(Unity.Entities.PresentationSystemGroup))],
    or by manually adding both systems to the same group's update list.
    UnityEngine.Debug:LogWarning (object)
    Unity.Debug:LogWarning (object) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/Stubs/Unity/Debug.cs:15)
    Unity.Entities.ComponentSystemSorter:WarnAboutAnySystemAttributeBadness (int,Unity.Entities.ComponentSystemGroup) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemSorter.cs:461)
    Unity.Entities.ComponentSystemGroup:GenerateMasterUpdateList () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:451)
    Unity.Entities.ComponentSystemGroup:RecurseUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:372)
    Unity.Entities.ComponentSystemGroup:SortSystems () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:559)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal (Unity.Entities.World,System.Collections.Generic.IEnumerable`1<System.Type>) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:279)
    Unity.Entities.DefaultWorldInitialization:Initialize (string,bool) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:154)
    Unity.Entities.DefaultWorldInitialization: DefaultLazyEditModeInitialize () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:341)
    Unity.Scenes.SubScene:OnEnable () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Scenes/SubScene.cs:318)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
    ----------------------------------------------------------------------------------
    Ignoring invalid [Unity.Entities.UpdateAfterAttribute] attribute on Unity.Rendering.MatrixPreviousSystem targeting Unity.Rendering.EntitiesGraphicsSystem.
    This attribute can only order systems that are members of the same ComponentSystemGroup instance.
    Make sure that both systems are in the same system group with [UpdateInGroup(typeof(Unity.Entities.PresentationSystemGroup))],
    or by manually adding both systems to the same group's update list.
    UnityEngine.Debug:LogWarning (object)
    Unity.Debug:LogWarning (object) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/Stubs/Unity/Debug.cs:15)
    Unity.Entities.ComponentSystemSorter:WarnAboutAnySystemAttributeBadness (int,Unity.Entities.ComponentSystemGroup) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemSorter.cs:461)
    Unity.Entities.ComponentSystemGroup:GenerateMasterUpdateList () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:451)
    Unity.Entities.ComponentSystemGroup:RecurseUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:372)
    Unity.Entities.ComponentSystemGroup:SortSystems () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/ComponentSystemGroup.cs:559)
    Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal (Unity.Entities.World,System.Collections.Generic.IEnumerable`1<System.Type>) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:279)
    Unity.Entities.DefaultWorldInitialization:Initialize (string,bool) (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:154)
    Unity.Entities.DefaultWorldInitialization: DefaultLazyEditModeInitialize () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Entities/DefaultWorldInitialization.cs:341)
    Unity.Scenes.SubScene:OnEnable () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.65/Unity.Scenes/SubScene.cs:318)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
    ----------------------------------------------------------------------------------
     
  2. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    56
  3. taabox

    taabox

    Joined:
    Feb 6, 2017
    Posts:
    4