Esempio n. 1
0
        public IEnumerator SingleTypeMultipleObjects()
        {
            GOPool goPool = BuildPoolOfSingleType(new GameObject(), 1);

            yield return(null);

            GameObject fromPool = goPool.PopDeactivatedObjectOrReturnNull();

            Assert.IsNotNull(fromPool);
            yield return(null);
        }
Esempio n. 2
0
        public IEnumerator SingleTypeMultipleSingleObjects()
        {
            const int poolSize = 10;
            GOPool    goPool   = BuildPoolOfSingleType(new GameObject(), 10);

            yield return(null);

            for (int i = 0; i < poolSize; i++)
            {
                GameObject fromPool = goPool.PopDeactivatedObjectOrReturnNull();
                Assert.IsNotNull(fromPool, "Expected not null @ " + i);
                fromPool.SetActive(true);
            }

            yield return(null);
        }