17 lines
601 B
C#
17 lines
601 B
C#
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
[System.Serializable] public class SupabaseClientSecrets { public string url; public string anonKey; }
|
|
|
|
public static class SupabaseSecretsLoader
|
|
{
|
|
public static async Task<SupabaseClientSecrets> LoadAsync()
|
|
{
|
|
var ta = Resources.Load<TextAsset>("SupabaseClientSecrets");
|
|
if (ta == null || string.IsNullOrWhiteSpace(ta.text))
|
|
throw new System.Exception("SupabaseClientSecrets.json missing. Did prebuild run?");
|
|
await Task.Yield();
|
|
return JsonUtility.FromJson<SupabaseClientSecrets>(ta.text);
|
|
}
|
|
}
|