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

Feedback Rename ENABLE_UNITY_COLLECTIONS_CHECKS

Discussion in 'Entity Component System' started by tertle, Aug 29, 2019.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,753
    The name is a bit legacy now as it is definitely not just used for Collection checks. It is used as a more general purpose editor only safety check.

    An example is World heavily uses it. One use is to ensure systems aren't created during deconstruction

    Code (CSharp):
    1. #if ENABLE_UNITY_COLLECTIONS_CHECKS
    2.             if (!m_AllowGetSystem)
    3.                 throw new ArgumentException(
    4.                     "During destruction of a system you are not allowed to create more systems.");
    5.  
    6.             m_AllowGetSystem = true;
    7. #endif
    I think a new name to reflect the more general usefulness of this property would be appropriate.
     
    Last edited: Aug 29, 2019
    Enzi, Orimay, S_Darkwell and 3 others like this.