private IResourceProvider InitializeProvider(ResourceProviderType providerType)
        {
            IResourceProvider provider;

            switch (providerType)
            {
            case ResourceProviderType.Project:
                provider = InitializeProjectProvider();
                break;

            case ResourceProviderType.Addressable:
                provider = InitializeAddresableProvider();
                break;

            case ResourceProviderType.Local:
                provider = InitializeLocalProvider();
                break;

            case ResourceProviderType.GoogleDrive:
                provider = InitializeGoogleDriveProvider();
                break;

            default:
                Debug.LogError($"Failed to initialize provider '{providerType}'.");
                return(null);
            }

            if (provider != null)
            {
                provider.OnLoadProgress += OnLoadProgress.SafeInvoke;
                provider.OnMessage      += (message) => HandleProviderMessage(provider, message);
            }

            return(provider);
        }
 public IResourceProvider GetProvider(ResourceProviderType providerType)
 {
     if (!providers.ContainsKey(providerType))
     {
         providers[providerType] = InitializeProvider(providerType);
     }
     return(providers[providerType]);
 }
 public bool IsProviderInitialized(ResourceProviderType providerType) => providers.ContainsKey(providerType);
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="ResourceProviderType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceProviderType.CreateFrom(sourceValue);