115 lines
3.7 KiB
C#
115 lines
3.7 KiB
C#
using UnityEngine;
|
|
|
|
namespace Tech3C
|
|
{
|
|
/// <summary>
|
|
/// Configuration class for Tech3C SDK
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "Tech3CConfig", menuName = "Tech3C SDK/Configuration", order = 1)]
|
|
public class Tech3CConfig : ScriptableObject
|
|
{
|
|
[Header("Client Credentials")]
|
|
[Tooltip("Client ID for Tech3C authentication")]
|
|
public string clientId;
|
|
|
|
[Tooltip("Client Secret for Tech3C authentication")]
|
|
public string clientSecret;
|
|
|
|
[Header("General Settings")]
|
|
[Tooltip("Enable debug mode for detailed logging")]
|
|
public bool debugMode = false;
|
|
|
|
[Tooltip("Display language for the SDK")]
|
|
public Language language = Language.English;
|
|
|
|
[Tooltip("Environment for the SDK")]
|
|
public Environment environment = Environment.Production;
|
|
|
|
[Header("UI Settings")]
|
|
[Tooltip("UI mode for authentication (Fullscreen or Dialog)")]
|
|
public UiMode uiMode = UiMode.Fullscreen;
|
|
|
|
[Tooltip("Dialog size when UI mode is Dialog")]
|
|
public DialogSize dialogSize = DialogSize.Medium;
|
|
|
|
[Tooltip("Screen orientation for authentication")]
|
|
public OrientationMode screenOrientation = OrientationMode.Auto;
|
|
|
|
[Tooltip("Disable exit button on login screen")]
|
|
public bool disableExitLogin = false;
|
|
|
|
[Header("Authentication Settings")]
|
|
[Tooltip("Enable guest login")]
|
|
public bool enableGuestLogin = false;
|
|
|
|
[Tooltip("Require OTP for authentication")]
|
|
public bool requireOtp = false;
|
|
|
|
[Tooltip("Enable Google login")]
|
|
public bool enableGoogleLogin = false;
|
|
|
|
[Tooltip("Enable Facebook login")]
|
|
public bool enableFacebookLogin = false;
|
|
|
|
[Tooltip("Enable Apple login")]
|
|
public bool enableAppleLogin = false;
|
|
|
|
[Header("Maintenance Settings")]
|
|
[Tooltip("Enable maintenance check")]
|
|
public bool enableMaintenanceCheck = false;
|
|
|
|
[Tooltip("Maintenance check URL")]
|
|
public string maintenanceCheckUrl;
|
|
|
|
[Tooltip("Server IP for maintenance check")]
|
|
public string serverIp;
|
|
|
|
[Header("Network Settings")]
|
|
[Tooltip("Timeout in seconds for network requests")]
|
|
public int timeoutSeconds = 30;
|
|
|
|
/// <summary>
|
|
/// Creates a default Tech3CConfig asset
|
|
/// </summary>
|
|
public static Tech3CConfig CreateDefault()
|
|
{
|
|
var config = CreateInstance<Tech3CConfig>();
|
|
config.clientId = "";
|
|
config.clientSecret = "";
|
|
config.debugMode = false;
|
|
config.language = Language.English;
|
|
config.environment = Environment.Production;
|
|
config.uiMode = UiMode.Fullscreen;
|
|
config.dialogSize = DialogSize.Medium;
|
|
config.screenOrientation = OrientationMode.Auto;
|
|
config.disableExitLogin = false;
|
|
config.enableGuestLogin = false;
|
|
config.requireOtp = false;
|
|
config.enableGoogleLogin = false;
|
|
config.enableFacebookLogin = false;
|
|
config.enableAppleLogin = false;
|
|
config.enableMaintenanceCheck = false;
|
|
config.maintenanceCheckUrl = "";
|
|
config.serverIp = "";
|
|
config.timeoutSeconds = 30;
|
|
return config;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validates the configuration
|
|
/// </summary>
|
|
public bool IsValid()
|
|
{
|
|
return !string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(clientSecret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the language code string
|
|
/// </summary>
|
|
public string GetLanguageCode()
|
|
{
|
|
return language == Language.Vietnamese ? "vi" : "en";
|
|
}
|
|
}
|
|
}
|