private static MobileAnalyticsManager GetOrCreateInstanceHelper(string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig) { #if BCL ValidateParameters(); #endif MobileAnalyticsManager managerInstance = null; bool isNewInstance = false; lock (_lock) { if (_instanceDictionary.TryGetValue(appID, out managerInstance)) { return(managerInstance); } else { managerInstance = new MobileAnalyticsManager(appID, credentials, regionEndpoint, maConfig); _instanceDictionary[appID] = managerInstance; isNewInstance = true; } } if (isNewInstance) { managerInstance.Session.Start(); } #if UNITY if (UnityEngine.Application.platform == UnityEngine.RuntimePlatform.WebGLPlayer) { _coroutineRunner.StartWork(); } else { _backgroundRunner.StartWork(); } #else _backgroundRunner.StartWork(); #endif return(managerInstance); }