Ejemplo n.º 1
0
        protected override IDisposable ReactToPools()
        {
            var componentType1 = ComponentTypeLookup.GetComponentType(typeof(T1));
            var componentType2 = ComponentTypeLookup.GetComponentType(typeof(T2));
            var pool1          = ComponentDatabase.GetPoolFor <T1>(componentType1);
            var pool2          = ComponentDatabase.GetPoolFor <T2>(componentType2);

            var subscriptions = new CompositeDisposable();

            pool1.OnPoolExtending.Subscribe(_ => Refresh()).AddTo(subscriptions);
            pool2.OnPoolExtending.Subscribe(_ => Refresh()).AddTo(subscriptions);

            return(subscriptions);
        }