Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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