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.

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:
    866
    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:
    866
    Sorry, wrong forum