Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

m_SystemToUpdate missing after Entities Package Update to 0.10

Discussion in 'Entity Component System' started by Opeth001, Apr 30, 2020.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    Hello Everyone,

    i added my own systemGroup which runs in the Update Method,
    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using UnityEngine.Scripting;
    4.  
    5.  
    6. namespace Unity.Entities
    7. {
    8.     [UnityEngine.ExecuteAlways]
    9.     [UpdateInGroup(typeof(UpdateSystemGroup))]
    10.     public class LateUpdateSystemGroup : ComponentSystemGroup { }
    11.    
    12.     public class UpdateSystemGroup : ComponentSystemGroup
    13.     {
    14.         [Preserve] public UpdateSystemGroup() { }
    15.  
    16.         public override void SortSystemUpdateList()
    17.         {
    18.             // Extract list of systems to sort (excluding built-in systems that are inserted at fixed points)
    19.             var toSort = new List<ComponentSystemBase>(m_systemsToUpdate.Count); // Error
    20.             LateUpdateSystemGroup lateSysGroup = null;
    21.             foreach (var s in m_systemsToUpdate) // Error
    22.             {
    23.                 if (s is LateUpdateSystemGroup)
    24.                 {
    25.                     lateSysGroup = (LateUpdateSystemGroup)s;
    26.                     lateSysGroup.SortSystemUpdateList(); // not handled by base-class sort call below
    27.                 }
    28.                 else
    29.                 {
    30.                     toSort.Add(s);
    31.                 }
    32.             }
    33.             m_systemsToUpdate = toSort;// Error
    34.             base.SortSystemUpdateList();
    35.             // Re-insert built-in systems to construct the final list
    36.             var finalSystemList = new List<ComponentSystemBase>(toSort.Count);
    37.             foreach (var s in m_systemsToUpdate)// Error
    38.                 finalSystemList.Add(s);
    39.             if (lateSysGroup != null)
    40.                 finalSystemList.Add(lateSysGroup);
    41.            
    42.             m_systemsToUpdate = finalSystemList;// Error
    43.         }
    44.        
    45.     }
    46.  
    47. }

    Error:
    The name 'm_systemsToUpdate' does not exist in the current context.

    it's strange cause the Entities Package use for creation of :InitializationSystemGroup , SimulationSystemGroup, PresentationSystemGroup.
     
    Deleted User and florianhanke like this.
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,655
    It's internal now,

    internal List<ComponentSystemBase> m_systemsToUpdate = new List<ComponentSystemBase>();

    previously it was protected.

    protected List<ComponentSystemBase> m_systemsToUpdate = new List<ComponentSystemBase>();
     
  3. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    290
    and how do we fix this now? I have the same code
     
  4. agurskis22cans

    agurskis22cans

    Joined:
    Jul 17, 2019
    Posts:
    9
    Call AddSystemToUpdate(system) method on a group itself.
     
  5. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    290
    you need to be a bit more specific on what is needed to do..
     
    ldc3, T-Zee and Opeth001 like this.
  6. Orimay

    Orimay

    Joined:
    Nov 16, 2012
    Posts:
    304
    This broke NetCode
     
    CPlusSharp22 and BelkinAlex like this.
  7. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    191
    This hit me a well. I'm updating my libs to adapt to the new normal. My use-case is a system group where I control the order. (not using the ExecuteBefore/After)

    They should just make it easy to create our own groups that can be seen in the entity debugger instead of forcing us to do these hacks. Maybe have an interface that defines the API that the entity debugger requires?
     
  8. bb8_1

    bb8_1

    Joined:
    Jan 20, 2019
    Posts:
    98
    Why when installing Netcode unity manager simply download all valid versions - or why in the Netcode manual there is no list of all valid versions of packages that Netcode depends on?

    Edit : it(package manager) shows actually on Advanced click on dependencies.
     
    Last edited: May 9, 2020
  9. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    95
    Can you give more info on this please?
     
    CPlusSharp22 likes this.
  10. MajorMilkMan

    MajorMilkMan

    Joined:
    Aug 26, 2015
    Posts:
    2
    Replace m_systemsToUpdate with Systems
     
  11. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    191
    Systems is a read-only version of m_systemsToUpdate, which only partially helps.