Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug [ECS 0.9.0] Part of CompanionGameObjectUpdateSystem not working

Discussion in '2020.1 Beta' started by iamarugin, Apr 13, 2020.

  1. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    The following code in CompanionGameObjectUpdateSystem doesn't work:
    Code (CSharp):
    1. var toDeactivate = Entities.WithAny<Disabled, Prefab>().WithAll<CompanionGameObjectActiveSystemState, CompanionLink>();
    2. toDeactivate.ForEach((CompanionLink link) => link.Companion.SetActive(false));
    3. EntityManager.RemoveComponent<CompanionGameObjectActiveSystemState>(toDeactivate.ToEntityQuery());
    because entities with Disabled or Prefab tag will not be included in entitiy query result. Adding .With(EntityQueryOptions.IncludeDisabled | EntityQueryOptions.IncludePrefab) to toDeactivate fixes this.
     
    Last edited: Apr 13, 2020
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Sorry, wrong forum