예제 #1
0
        public AsyncOperationHandle <List <IResourceLocator> > Start(IEnumerable <string> catalogIds)
        {
            m_LocatorInfos = new List <AddressablesImpl.ResourceLocatorInfo>();
            var locations = new List <IResourceLocation>();

            foreach (var c in catalogIds)
            {
                var loc = m_Addressables.GetLocatorInfo(c);
                locations.Add(loc.CatalogLocation);
                m_LocatorInfos.Add(loc);
            }
            if (locations.Count == 0)
            {
                return(m_Addressables.ResourceManager.CreateCompletedOperation(default(List <IResourceLocator>), "Content update not available."));
            }

            ContentCatalogProvider ccp = m_Addressables.ResourceManager.ResourceProviders
                                         .FirstOrDefault(rp => rp.GetType() == typeof(ContentCatalogProvider)) as ContentCatalogProvider;

            if (ccp != null)
            {
                ccp.DisableCatalogUpdateOnStart = false;
            }

            m_DepOp = m_Addressables.ResourceManager.CreateGroupOperation <object>(locations);
            return(m_Addressables.ResourceManager.StartOperation(this, m_DepOp));
        }
예제 #2
0
        public AsyncOperationHandle <List <IResourceLocator> > Start(IEnumerable <string> catalogIds)
        {
            m_LocatorInfos = new List <AddressablesImpl.ResourceLocatorInfo>();
            var locations = new List <IResourceLocation>();

            foreach (var c in catalogIds)
            {
                var loc = m_Addressables.GetLocatorInfo(c);
                locations.Add(loc.CatalogLocation);
                m_LocatorInfos.Add(loc);
            }
            if (locations.Count == 0)
            {
                return(m_Addressables.ResourceManager.CreateCompletedOperation(default(List <IResourceLocator>), "Content update not available."));
            }

            m_DepOp = m_Addressables.ResourceManager.CreateGroupOperation <object>(locations);
            return(m_Addressables.ResourceManager.StartOperation(this, m_DepOp));
        }