restructure

This commit is contained in:
tom.hempel
2025-09-30 18:03:19 +02:00
parent 69b0c79692
commit 78e5dcd53e
4821 changed files with 762 additions and 417 deletions

View File

@ -0,0 +1,33 @@
using System;
using Convai.Scripts.Runtime.Addons;
using UnityEngine;
public class ConvaiAPIKeySetup : ScriptableObject
{
private const string RESOURCE_PATH = "ConvaiAPIKey";
private static ConvaiAPIKeySetup _instance;
public string APIKey;
public static event Action OnAPIKeyNotFound;
public static bool GetAPIKey(out string apiKey)
{
if (_instance == null) _instance = Resources.Load<ConvaiAPIKeySetup>(RESOURCE_PATH);
if (_instance == null || string.IsNullOrEmpty(_instance.APIKey))
{
NotifyAPIKeyNotFound();
apiKey = string.Empty;
return false;
}
apiKey = _instance.APIKey;
return true;
}
private static void NotifyAPIKeyNotFound()
{
if (NotificationSystemHandler.Instance != null) NotificationSystemHandler.Instance.NotificationRequest(NotificationType.APIKeyNotFound);
OnAPIKeyNotFound?.Invoke();
}
}