private static void GetFirebaseUrl(List <object> keys, FirebaseStorage fbStorage, Action completed)
        {
            if (runningFetchUrlOperationCount > 0)
            {
                Debug.LogError("Wait until the previous operation is completed before starting a new one");
                return;
            }
            runningFetchUrlOperationCount = 0;
            foreach (var key in keys)
            {
                foreach (IResourceLocator locator in UnityEngine.AddressableAssets.Addressables.ResourceLocators)
                {
                    if (locator.Locate(key, typeof(object), out IList <IResourceLocation> locations))
                    {
                        foreach (IResourceLocation location in locations)
                        {
                            foreach (var dependency in location.Dependencies)
                            {
                                string firebaseUrl = UnityEngine.AddressableAssets.Addressables.ResourceManager.TransformInternalId(dependency);
                                if (FirebaseAddressablesManager.IsFirebaseStorageLocation(firebaseUrl) == false)
                                {
                                    continue;
                                }

                                StorageReference reference = fbStorage.GetReferenceFromUrl(firebaseUrl);

                                StartUrlFetch(completed, reference, firebaseUrl);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void Provide(ProvideHandle provideHandle)
        {
            var url = UnityEngine.AddressableAssets.Addressables.ResourceManager.TransformInternalId(provideHandle.Location);

            if (FirebaseAddressablesManager.IsFirebaseStorageLocation(url) == false)
            {
                base.Provide(provideHandle);
                return;
            }

            this.provideHandle = provideHandle;
            if (FirebaseAddressablesManager.IsFirebaseSetupFinished)
            {
                LoadManifest();
            }
            else
            {
                FirebaseAddressablesManager.FirebaseSetupFinished += LoadManifest;
            }
        }