internal static AsyncOperationHandle <IResourceLocator> CreateInitializationOperation(AddressablesImpl aa, string playerSettingsLocation, string providerSuffix) { var jp = new JsonAssetProvider(); jp.IgnoreFailures = true; aa.ResourceManager.ResourceProviders.Add(jp); var tdp = new TextDataProvider(); tdp.IgnoreFailures = true; aa.ResourceManager.ResourceProviders.Add(tdp); aa.ResourceManager.ResourceProviders.Add(new ContentCatalogProvider(aa.ResourceManager)); var runtimeDataLocation = new ResourceLocationBase("RuntimeData", playerSettingsLocation, typeof(JsonAssetProvider).FullName, typeof(ResourceManagerRuntimeData)); var initOp = new InitializationOperation(aa); initOp.m_rtdOp = aa.ResourceManager.ProvideResource <ResourceManagerRuntimeData>(runtimeDataLocation); initOp.m_ProviderSuffix = providerSuffix; initOp.m_InitGroupOps = new InitalizationObjectsOperation(); initOp.m_InitGroupOps.Init(initOp.m_rtdOp, aa); var groupOpHandle = aa.ResourceManager.StartOperation(initOp.m_InitGroupOps, initOp.m_rtdOp); return(aa.ResourceManager.StartOperation <IResourceLocator>(initOp, groupOpHandle)); }
public static IDataProvider GetProvider(DataTypeEnum dataType) { IDataProvider dataProvider = null; switch (dataType) { case DataTypeEnum.Text: dataProvider = new TextDataProvider(); break; case DataTypeEnum.Xml: dataProvider = new XmlDataProvider(); break; case DataTypeEnum.Json: dataProvider = new JsonDataProvider(); break; default: break; } return(dataProvider); }
public TextDataProviderStub(string fakeRemoteFolder, TextDataProvider textDataProvider) { m_TextDataProvider = textDataProvider; m_FakeRemoteFolder = fakeRemoteFolder; }