com.guru.unity.sdk/Runtime/Code/SDK/GuruSDK.Callback.cs

157 lines
5.0 KiB
C#

namespace Guru
{
using System;
using UnityEngine;
public partial class GuruSDK
{
/// <summary>
/// 回调参数类
/// </summary>
public class Callbacks
{
/// <summary>
/// APP 事件
/// </summary>
public static class App
{
internal static Action<bool> _onAppPaused;
public static event Action<bool> OnAppPaused
{
add => _onAppPaused += value;
remove => _onAppPaused -= value;
}
internal static Action _onAppQuit;
public static event Action OnAppQuit
{
add => _onAppQuit += value;
remove => _onAppQuit -= value;
}
}
/// <summary>
/// GDPR Consent
/// </summary>
public static class ConsentFlow
{
/// <summary>
/// 当Consent启动结束后返回状态码
/// </summary>
public static event Action<int> OnConsentResult
{
add => _onConsentResult += value;
remove => _onConsentResult -= value;
}
internal static Action<int> _onConsentResult;
/// <summary>
/// ATT 状态返回
/// </summary>
public static event Action<int> OnAttResult
{
add => _onAttResult += value;
remove => _onAttResult -= value;
}
internal static Action<int> _onAttResult;
}
/// <summary>
/// 广告回调
/// </summary>
public static class Ads
{
internal static Action _onAdsInitComplete;
public static event Action OnAdsInitComplete
{
add => _onAdsInitComplete += value;
remove => _onAdsInitComplete -= value;
}
internal static Action _onInterstitialADLoaded;
public static event Action OnInterstitialADLoaded
{
add => _onInterstitialADLoaded += value;
remove => _onInterstitialADLoaded -= value;
}
internal static Action _onInterstitialADFailed;
public static event Action OnInterstitialADFailed
{
add => _onInterstitialADFailed += value;
remove => _onInterstitialADFailed -= value;
}
internal static Action _onRewardedADLoaded;
public static event Action OnRewardedADLoaded
{
add => _onRewardedADLoaded += value;
remove => _onRewardedADLoaded -= value;
}
internal static Action _onRewardADFailed;
public static event Action OnRewardADFailed
{
add => _onRewardADFailed += value;
remove => _onRewardADFailed -= value;
}
}
/// <summary>
/// 云控参数
/// </summary>
public static class Remote
{
internal static Action _onRemoteInitComplete;
public static event Action OnRemoteInitComplete
{
add => _onRemoteInitComplete += value;
remove => _onRemoteInitComplete -= value;
}
internal static Action<bool> _onRemoteFetchComplete;
public static event Action<bool> OnRemoteFetchComplete
{
add => _onRemoteFetchComplete += value;
remove => _onRemoteFetchComplete -= value;
}
}
/// <summary>
/// 支付回调
/// </summary>
public static class IAP
{
internal static Action<bool> _onIAPInitComplete;
public static event Action<bool> OnIAPInitComplete
{
add => _onIAPInitComplete += value;
remove => _onIAPInitComplete -= value;
}
internal static Action<string> _onPurchaseStart;
public static event Action<string> OnPurchaseStart
{
add => _onPurchaseStart += value;
remove => _onPurchaseStart -= value;
}
internal static Action<string, string> _onPurchaseFailed;
public static event Action<string, string> OnPurchaseFailed
{
add => _onPurchaseFailed += value;
remove => _onPurchaseFailed -= value;
}
}
}
}
}