//NOTE: This needs Sturfee.Unity.XR>Providers.dll to work private void SetupDefaultProivders() { if (ImuProvider == null || !ImuProvider.IsSupported()) { Debug.Log("ImuProvider is Null or not supported. Using Sturfee default ImuProvider"); #if UNITY_ANDROID ImuProvider = gameObject.AddComponent <SturfeeAndroidImuProvider>(); #elif UNITY_IOS ImuProvider = gameObject.AddComponent <SturfeeIOSImuProvider>(); #endif } if (GpsProvider == null || !GpsProvider.IsSupported()) { Debug.Log("GpsProvider is Null or not supported. Using Sturfee default GpsProvider"); GpsProvider = gameObject.AddComponent <SturfeeGpsProvider>(); } if (VideoProvider == null || !VideoProvider.IsSupported()) { Debug.Log("VideoProvider is Null or not supported. Using Sturfee default VideoProvider"); VideoProvider = gameObject.AddComponent <SturfeeVideoProvider>(); } if (CameraProvider == null || !CameraProvider.IsSupported()) { Debug.Log("CameraProvider is Null or not supported. Using Sturfee default CameraProvider"); CameraProvider = gameObject.AddComponent <SturfeeCameraProvider>(); } if (LightingProvider == null || !LightingProvider.IsSupported()) { Debug.Log("LightingProvider is Null or not supported. Using Sturfee default LightingProvider"); LightingProvider = gameObject.AddComponent <SturfeeLightingProvider>(); } }
private IEnumerator Start() { _sampleGpsProvider = GetComponent <GpsProviderBase>(); _sampleImuProvider = GetComponent <ImuProviderBase>(); _sampleVideoProvider = GetComponent <VideoProviderBase>(); yield return(new WaitForEndOfFrame()); // First check Cache if (File.Exists(CacheDirectory + "/Data.txt")) { string dataJson = File.ReadAllText(CacheDirectory + "/Data.txt"); _sampleDatas = JsonHelper.FromJson <SampleData>(dataJson); OnSampleDataReady?.Invoke(); } else { // Download from AWS StartCoroutine(DownloadSampleData((data) => { string dataJson = data; _sampleDatas = JsonHelper.FromJson <SampleData>(dataJson); OnSampleDataReady?.Invoke(); })); } }