101 lines
3.2 KiB
C#
101 lines
3.2 KiB
C#
namespace Guru
|
||
{
|
||
using System.Collections.Generic;
|
||
using System.Text;
|
||
/// <summary>
|
||
/// 启动参数配置
|
||
/// </summary>
|
||
public partial class GuruSDKInitConfig
|
||
{
|
||
/// <summary>
|
||
/// 使用自定义的ConsentFlow启动流程
|
||
/// </summary>
|
||
public bool UseCustomConsent = false;
|
||
/// <summary>
|
||
/// SDK初始化完成后自动加载广告
|
||
/// </summary>
|
||
public bool AutoLoadWhenAdsReady = true;
|
||
/// <summary>
|
||
/// 使用IAP支付插件功能
|
||
/// </summary>
|
||
public bool IAPEnabled = true;
|
||
/// <summary>
|
||
/// 自动记录完成的关卡
|
||
/// </summary>
|
||
public bool AutoRecordFinishedLevels = true;
|
||
/// <summary>
|
||
/// 自定义 Service 云控 Key
|
||
/// </summary>
|
||
public string CustomServiceKey = "";
|
||
/// <summary>
|
||
/// Debug模式(默认关闭)
|
||
/// </summary>
|
||
public bool DebugMode = false;
|
||
/// <summary>
|
||
/// 云控参数的默认配置
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public Dictionary<string, object> DefaultRemoteData = new Dictionary<string, object>();
|
||
|
||
/// <summary>
|
||
/// 支付初始化Keys
|
||
/// </summary>
|
||
public byte[] GoogleKeys;
|
||
public byte[] AppleRootCerts;
|
||
|
||
#region Initialization
|
||
|
||
/// <summary>
|
||
/// 构建启动配置
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public static GuruSDKInitConfig Build(
|
||
bool useCustomConsent = false,
|
||
bool autoLoadAds = true,
|
||
bool iapEnabled = true,
|
||
bool autoRecordFinishedLevels = true,
|
||
bool debugMode = false,
|
||
Dictionary<string, object> defaultRemoteData = null,
|
||
byte[] googleKeys = null,
|
||
byte[] appleRootCerts = null)
|
||
{
|
||
// 创建启动用参数
|
||
GuruSDKInitConfig config = new GuruSDKInitConfig()
|
||
{
|
||
UseCustomConsent = useCustomConsent,
|
||
AutoLoadWhenAdsReady = autoLoadAds,
|
||
IAPEnabled = iapEnabled,
|
||
AutoRecordFinishedLevels = autoRecordFinishedLevels,
|
||
DebugMode = debugMode,
|
||
GoogleKeys = googleKeys,
|
||
AppleRootCerts = appleRootCerts,
|
||
DefaultRemoteData = defaultRemoteData ?? new Dictionary<string, object>(),
|
||
};
|
||
#if UNITY_EDITOR
|
||
config.DebugMode = true;
|
||
#endif
|
||
return config;
|
||
}
|
||
|
||
|
||
#endregion
|
||
|
||
#region Print
|
||
|
||
public override string ToString()
|
||
{
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.AppendLine($"------- Custom init Config -------");
|
||
sb.AppendLine($"\tUseCustomConsent: {UseCustomConsent}");
|
||
sb.AppendLine($"\tAutoLoadWhenAdsReady: {AutoLoadWhenAdsReady}");
|
||
sb.AppendLine($"\tIAPEnabled: {IAPEnabled}");
|
||
sb.AppendLine($"\tShowDebugLog: {DebugMode}");
|
||
sb.AppendLine($"------- Custom init Config -------");
|
||
return sb.ToString();
|
||
}
|
||
|
||
|
||
|
||
#endregion
|
||
}
|
||
} |