예제 #1
0
        public bool TryGetComponents(TypeCache componentType, out ComponentArray comp)
        {
            for (int i = 0; i < componentCollections.Length; i++)
            {
                ComponentArray currCollection = componentCollections[i];
                if (currCollection.TypeMatch(componentType))
                {
                    comp = currCollection;
                    return(true);
                }
            }

            comp = null;
            return(false);
        }
예제 #2
0
        public bool TryGetComponents <T0>(out ComponentArray comp) where T0 : IComponent
        {
            for (int i = 0; i < componentCollections.Length; i++)
            {
                ComponentArray currCollection = componentCollections[i];
                if (currCollection.TypeMatch <T0>())
                {
                    comp = currCollection;
                    return(true);
                }
            }

            comp = null;
            return(false);
        }