static void SaveAsset(FirebaseSettings instance) { string dir = "Assets/Resources"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } #if UNITY_EDITOR AssetDatabase.CreateAsset(instance, "Assets/Resources/FirebaseRestClient.asset"); AssetDatabase.SaveAssets(); #endif }
public static void LoadSettings() { if (instance) { return; } instance = FindOrCreateInstance(); FirebaseConfig.endpoint = instance.endpoint.EndsWith("/") ? instance.endpoint : instance.endpoint + "/"; FirebaseConfig.api = instance.webApi; FirebaseConfig.googleClientId = instance.googleClientId; FirebaseConfig.googleClientSecret = instance.googleClientSecret; FirebaseConfig.facebookClientId = instance.facebookClientId; FirebaseConfig.facebookClientSecret = instance.facebookClientSecret; FirebaseConfig.storageEndpoint = string.Format("https://firebasestorage.googleapis.com/v0/b/{0}/o", instance.storageEndpoint); }
/// <summary> /// Create Firebase Realtime Database Instance /// </summary> public RealtimeDatabase() { FirebaseSettings.LoadSettings(); }
public FirebaseStorage() { FirebaseSettings.LoadSettings(); }