コード例 #1
0
        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
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 /// <summary>
 /// Create Firebase Realtime Database Instance
 /// </summary>
 public RealtimeDatabase()
 {
     FirebaseSettings.LoadSettings();
 }
コード例 #4
0
 public FirebaseStorage()
 {
     FirebaseSettings.LoadSettings();
 }