コード例 #1
0
 private void OnComponentRemoved(IEntity entity, Type component)
 {
     _families.Lock();
     foreach (var pair in _families)
     {
         pair.ComponentRemoved(entity, component);
     }
     _families.UnLock();
 }
コード例 #2
0
        public void AfterLocking_FamilyCanBeRetrieved()
        {
            _container.Add(typeof(Node <SpriteRenderer>), Substitute.For <IFamily>());
            _container.Add(typeof(Node <Transform>), Substitute.For <IFamily>());

            _container.Lock();

            foreach (var family in _container)
            {
                _container.Add(typeof(Node <BoxCollider2D>), Substitute.For <IFamily>());
            }

            _container.UnLock();

            _container.Get(typeof(Node <BoxCollider2D>));
        }