diff --git a/Assets/Scripts/FirebaseInitializer.cs b/Assets/Scripts/FirebaseInitializer.cs new file mode 100644 index 0000000..0f197ed --- /dev/null +++ b/Assets/Scripts/FirebaseInitializer.cs @@ -0,0 +1,46 @@ +using Firebase; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; + +public class FirebaseInitializer : MonoBehaviour +{ + public UnityEvent onFirebaseReady; + public static FirebaseInitializer Instance; + + void Awake() + { + Instance = this; + } + + // Start is called before the first frame update + void Start() + { + Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => + { + var dependencyStatus = task.Result; + if (dependencyStatus == Firebase.DependencyStatus.Available) + { + // Create and hold a reference to your FirebaseApp, + // where app is a Firebase.FirebaseApp property of your application class. + var app = Firebase.FirebaseApp.DefaultInstance; + onFirebaseReady?.Invoke(); + + // Set a flag here to indicate whether Firebase is ready to use by your app. + } + else + { + UnityEngine.Debug.LogError(System.String.Format( + "Could not resolve all Firebase dependencies: {0}", dependencyStatus)); + // Firebase Unity SDK is not safe to use here. + } + }); + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/FirebaseInitializer.cs.meta b/Assets/Scripts/FirebaseInitializer.cs.meta new file mode 100644 index 0000000..15b1e53 --- /dev/null +++ b/Assets/Scripts/FirebaseInitializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 153bd176c0ad8f82692512264f5245ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index c8197af..e2a4c60 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -4,6 +4,7 @@ "com.unity.feature.development": "1.0.1", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.7.6", + "com.unity.toolchain.linux-x86_64": "2.0.6", "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6", "com.unity.ugui": "1.0.0", "com.unity.visualscripting": "1.9.1", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index af5a414..5fbe1a9 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -132,6 +132,16 @@ }, "url": "https://packages.unity.com" }, + "com.unity.toolchain.linux-x86_64": { + "version": "2.0.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.sysroot": "2.0.7", + "com.unity.sysroot.linux-x86_64": "2.0.6" + }, + "url": "https://packages.unity.com" + }, "com.unity.toolchain.win-x86_64-linux-x86_64": { "version": "2.0.6", "depth": 0, diff --git a/ProjectSettings/GvhProjectSettings.xml b/ProjectSettings/GvhProjectSettings.xml index 9e22339..47fce63 100644 --- a/ProjectSettings/GvhProjectSettings.xml +++ b/ProjectSettings/GvhProjectSettings.xml @@ -1,7 +1,5 @@ - -