Compare commits
7 Commits
62046f4bdc
...
dev_video
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1db5db6a77 | ||
| 3f78e8464a | |||
| 1d7d224682 | |||
| 7d479b7758 | |||
| 79f989f4ed | |||
| abe11029cc | |||
| 6ec1b20d36 |
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da76ae4f9ba92124087139583d0dd929
|
||||
guid: 7863556d88b814e09ba9cfc75a91d655
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
71
sdk-intergration/Assets/AppsFlyer/AFAdRevenueData.cs
Normal file
71
sdk-intergration/Assets/AppsFlyer/AFAdRevenueData.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public enum MediationNetwork : ulong
|
||||
{
|
||||
GoogleAdMob = 1,
|
||||
IronSource = 2,
|
||||
ApplovinMax = 3,
|
||||
Fyber = 4,
|
||||
Appodeal = 5,
|
||||
Admost = 6,
|
||||
Topon = 7,
|
||||
Tradplus = 8,
|
||||
Yandex = 9,
|
||||
ChartBoost = 10,
|
||||
Unity = 11,
|
||||
ToponPte = 12,
|
||||
Custom = 13,
|
||||
DirectMonetization = 14
|
||||
}
|
||||
|
||||
public static class AdRevenueScheme
|
||||
{
|
||||
/**
|
||||
* code ISO 3166-1 format
|
||||
*/
|
||||
public const string COUNTRY = "country";
|
||||
|
||||
/**
|
||||
* ID of the ad unit for the impression
|
||||
*/
|
||||
public const string AD_UNIT = "ad_unit";
|
||||
|
||||
/**
|
||||
* Format of the ad
|
||||
*/
|
||||
public const string AD_TYPE = "ad_type";
|
||||
|
||||
/**
|
||||
* ID of the ad placement for the impression
|
||||
*/
|
||||
public const string PLACEMENT = "placement";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
// Data class representing ad revenue information.
|
||||
//
|
||||
// @property monetizationNetwork The name of the network that monetized the ad.
|
||||
// @property mediationNetwork An instance of MediationNetwork representing the mediation service used.
|
||||
// @property currencyIso4217Code The ISO 4217 currency code describing the currency of the revenue.
|
||||
// @property eventRevenue The amount of revenue generated by the ad.
|
||||
/// </summary>
|
||||
public class AFAdRevenueData
|
||||
{
|
||||
public string monetizationNetwork { get; private set; }
|
||||
public MediationNetwork mediationNetwork { get; private set; }
|
||||
public string currencyIso4217Code { get; private set; }
|
||||
public double eventRevenue { get; private set; }
|
||||
|
||||
public AFAdRevenueData(string monetization, MediationNetwork mediation, string currency, double revenue)
|
||||
{
|
||||
monetizationNetwork = monetization;
|
||||
mediationNetwork = mediation;
|
||||
currencyIso4217Code = currency;
|
||||
eventRevenue = revenue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
11
sdk-intergration/Assets/AppsFlyer/AFAdRevenueData.cs.meta
Normal file
11
sdk-intergration/Assets/AppsFlyer/AFAdRevenueData.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49e1906ae949e4bfea400bd1da9f7e39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,34 +0,0 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class AFAdRevenueEvent {
|
||||
|
||||
/**
|
||||
*Pre-defined keys for non-mandatory dictionary
|
||||
*Code ISO 3166-1 format
|
||||
**/
|
||||
public const string COUNTRY = "country";
|
||||
|
||||
/**
|
||||
*ID of the ad unit for the impression
|
||||
**/
|
||||
public const string AD_UNIT = "ad_unit";
|
||||
|
||||
/**
|
||||
*Format of the ad
|
||||
**/
|
||||
public const string AD_TYPE = "ad_type";
|
||||
|
||||
/**
|
||||
*ID of the ad placement for the impression
|
||||
**/
|
||||
public const string PLACEMENT = "placement";
|
||||
|
||||
/**
|
||||
*Provided by Facebook Audience Network only, and will be reported to publishers
|
||||
*approved by Facebook Audience Network within the closed beta
|
||||
**/
|
||||
public const string ECPM_PAYLOAD = "ecpm_payload";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b73b301ad8b6f4b45809980800a9358a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -28,7 +28,6 @@ public class AFInAppEvents {
|
||||
public const string LOCATION_CHANGED = "af_location_changed";
|
||||
public const string LOCATION_COORDINATES = "af_location_coordinates";
|
||||
public const string ORDER_ID = "af_order_id";
|
||||
public const string GA = "af_ga_event";
|
||||
/**
|
||||
* Event Parameter Name
|
||||
* **/
|
||||
|
||||
0
sdk-intergration/Assets/AppsFlyer/AFMiniJSON.cs
Normal file → Executable file
0
sdk-intergration/Assets/AppsFlyer/AFMiniJSON.cs
Normal file → Executable file
@@ -10,24 +10,19 @@ namespace AppsFlyerSDK
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
//
|
||||
/// Purchase details class matching Android SDK AFPurchaseDetails
|
||||
/// </summary>
|
||||
public class AFPurchaseDetailsAndroid
|
||||
|
||||
{
|
||||
public AFPurchaseType purchaseType { get; private set; }
|
||||
public string purchaseToken { get; private set; }
|
||||
public string productId { get; private set; }
|
||||
public string price { get; private set; }
|
||||
public string currency { get; private set; }
|
||||
|
||||
public AFPurchaseDetailsAndroid(AFPurchaseType type, String purchaseToken, String productId, String price, String currency)
|
||||
public AFPurchaseDetailsAndroid(AFPurchaseType type, String purchaseToken, String productId)
|
||||
{
|
||||
this.purchaseType = type;
|
||||
this.purchaseToken = purchaseToken;
|
||||
this.productId = productId;
|
||||
this.price = price;
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,26 +4,33 @@ using System.Collections.Generic;
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
/// <summary>
|
||||
//
|
||||
/// Purchase type enum matching iOS SDK AFSDKPurchaseType
|
||||
/// </summary>
|
||||
public enum AFSDKPurchaseType
|
||||
{
|
||||
Subscription,
|
||||
OneTimePurchase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Purchase details class matching iOS SDK AFSDKPurchaseDetails
|
||||
/// </summary>
|
||||
public class AFSDKPurchaseDetailsIOS
|
||||
{
|
||||
public string productId { get; private set; }
|
||||
public string price { get; private set; }
|
||||
public string currency { get; private set; }
|
||||
public string transactionId { get; private set; }
|
||||
public AFSDKPurchaseType purchaseType { get; private set; }
|
||||
|
||||
private AFSDKPurchaseDetailsIOS(string productId, string price, string currency, string transactionId)
|
||||
private AFSDKPurchaseDetailsIOS(string productId, string transactionId, AFSDKPurchaseType purchaseType)
|
||||
{
|
||||
this.productId = productId;
|
||||
this.price = price;
|
||||
this.currency = currency;
|
||||
this.transactionId = transactionId;
|
||||
this.purchaseType = purchaseType;
|
||||
}
|
||||
|
||||
public static AFSDKPurchaseDetailsIOS Init(string productId, string price, string currency, string transactionId)
|
||||
public static AFSDKPurchaseDetailsIOS Init(string productId, string transactionId, AFSDKPurchaseType purchaseType)
|
||||
{
|
||||
return new AFSDKPurchaseDetailsIOS(productId, price, currency, transactionId);
|
||||
return new AFSDKPurchaseDetailsIOS(productId, transactionId, purchaseType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ namespace AppsFlyerSDK
|
||||
{
|
||||
public class AppsFlyer : MonoBehaviour
|
||||
{
|
||||
|
||||
public static readonly string kAppsFlyerPluginVersion = "6.14.3";
|
||||
public static readonly string kAppsFlyerPluginVersion = "6.17.7";
|
||||
public static string CallBackObjectName = null;
|
||||
private static EventHandler onRequestResponse;
|
||||
private static EventHandler onInAppResponse;
|
||||
@@ -333,6 +332,19 @@ namespace AppsFlyerSDK
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs ad revenue data along with additional parameters if provided.
|
||||
/// </summary>
|
||||
/// <param name = "adRevenueData" >instance of AFAdRevenueData containing ad revenue information.</param>
|
||||
/// <param name = "additionalParameters" >An optional map of additional parameters to be logged with ad revenue data. This can be null if there are no additional parameters.</param>
|
||||
public static void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
instance.logAdRevenue(adRevenueData, additionalParameters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually record the location of the user.
|
||||
/// </summary>
|
||||
@@ -766,12 +778,12 @@ namespace AppsFlyerSDK
|
||||
}
|
||||
|
||||
// V2
|
||||
public static void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> extraEventValues, MonoBehaviour gameObject)
|
||||
public static void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
if (instance != null && instance is IAppsFlyerIOSBridge)
|
||||
{
|
||||
IAppsFlyerIOSBridge appsFlyeriOSInstance = (IAppsFlyerIOSBridge)instance;
|
||||
appsFlyeriOSInstance.validateAndSendInAppPurchase(details, extraEventValues, gameObject);
|
||||
appsFlyeriOSInstance.validateAndSendInAppPurchase(details, purchaseAdditionalDetails, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,12 +797,12 @@ namespace AppsFlyerSDK
|
||||
}
|
||||
|
||||
// V2
|
||||
public static void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject)
|
||||
public static void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
if (instance != null && instance is IAppsFlyerAndroidBridge)
|
||||
{
|
||||
IAppsFlyerAndroidBridge appsFlyerAndroidInstance = (IAppsFlyerAndroidBridge)instance;
|
||||
appsFlyerAndroidInstance.validateAndSendInAppPurchase(details, additionalParameters, gameObject);
|
||||
appsFlyerAndroidInstance.validateAndSendInAppPurchase(details, purchaseAdditionalDetails, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public class AppsFlyerAdRevenue : MonoBehaviour
|
||||
{
|
||||
|
||||
public static readonly string kAppsFlyerAdRevenueVersion = "6.14.3";
|
||||
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
private static AndroidJavaClass appsFlyerAndroid = new AndroidJavaClass("com.appsflyer.unity.afunityadrevenuegenericplugin.AdRevenueUnityWrapper");
|
||||
#endif
|
||||
|
||||
public static void start()
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
_start();
|
||||
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
|
||||
using(AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
|
||||
|
||||
using(AndroidJavaObject cls_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity")) {
|
||||
|
||||
AndroidJavaObject cls_Application = cls_Activity.Call<AndroidJavaObject>("getApplication");
|
||||
|
||||
appsFlyerAndroid.CallStatic("start", cls_Application);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static void setIsDebug(bool isDebug)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setIsDebugAdrevenue(isDebug);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void logAdRevenue(string monetizationNetwork,
|
||||
AppsFlyerAdRevenueMediationNetworkType mediationNetwork,
|
||||
double eventRevenue,
|
||||
string revenueCurrency,
|
||||
Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
_logAdRevenue(monetizationNetwork, mediationNetwork, eventRevenue, revenueCurrency, AFMiniJSON.Json.Serialize(additionalParameters));
|
||||
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
|
||||
int mediationNetworkAndroid = setMediationNetworkTypeAndroid(mediationNetwork);
|
||||
if (mediationNetworkAndroid == -1)
|
||||
{
|
||||
Debug.Log("Please choose a valid mediationNetwork");
|
||||
} else
|
||||
{
|
||||
appsFlyerAndroid.CallStatic("logAdRevenue",
|
||||
monetizationNetwork,
|
||||
mediationNetworkAndroid,
|
||||
revenueCurrency,
|
||||
eventRevenue,
|
||||
convertDictionaryToJavaMap(additionalParameters));
|
||||
|
||||
}
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _start();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setIsDebugAdrevenue(bool isDebug);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _logAdRevenue(string monetizationNetwork,
|
||||
AppsFlyerAdRevenueMediationNetworkType mediationNetwork,
|
||||
double eventRevenue,
|
||||
string revenueCurrency,
|
||||
string additionalParameters);
|
||||
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
private static int setMediationNetworkTypeAndroid(AppsFlyerAdRevenueMediationNetworkType mediationNetwork)
|
||||
{
|
||||
switch (mediationNetwork)
|
||||
{
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeIronSource:
|
||||
return 0;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeApplovinMax:
|
||||
return 1;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob:
|
||||
return 2;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeFyber:
|
||||
return 3;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeAppodeal:
|
||||
return 4;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeAdmost:
|
||||
return 5;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeTopon:
|
||||
return 6;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeTradplus:
|
||||
return 7;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeYandex:
|
||||
return 8;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeChartBoost:
|
||||
return 9;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeUnity:
|
||||
return 10;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeCustomMediation:
|
||||
return 11;
|
||||
case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypedirectMonetization:
|
||||
return 12;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
private static AndroidJavaObject convertDictionaryToJavaMap(Dictionary<string, string> dictionary)
|
||||
{
|
||||
AndroidJavaObject map = new AndroidJavaObject("java.util.HashMap");
|
||||
IntPtr putMethod = AndroidJNIHelper.GetMethodID(map.GetRawClass(), "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
jvalue[] val;
|
||||
if (dictionary != null)
|
||||
{
|
||||
foreach (var entry in dictionary)
|
||||
{
|
||||
val = AndroidJNIHelper.CreateJNIArgArray(new object[] { entry.Key, entry.Value });
|
||||
AndroidJNI.CallObjectMethod(map.GetRawObject(), putMethod, val);
|
||||
AndroidJNI.DeleteLocalRef(val[0].l);
|
||||
AndroidJNI.DeleteLocalRef(val[1].l);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum AppsFlyerAdRevenueMediationNetworkType
|
||||
{
|
||||
AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob = 1,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeIronSource = 2,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeApplovinMax = 3,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeFyber = 4,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeAppodeal = 5,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeAdmost = 6,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeTopon = 7,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeTradplus = 8,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeYandex = 9,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeChartBoost = 10,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeUnity = 11,
|
||||
AppsFlyerAdRevenueMediationNetworkTypeCustomMediation = 12,
|
||||
AppsFlyerAdRevenueMediationNetworkTypedirectMonetization = 13
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 644005ac4602e4b78ad3a8d4d29e329d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -398,7 +398,23 @@ namespace AppsFlyerSDK
|
||||
public void setConsentData(AppsFlyerConsent appsFlyerConsent)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setConsentData", appsFlyerConsent.isUserSubjectToGDPR, appsFlyerConsent.hasConsentForDataUsage, appsFlyerConsent.hasConsentForAdsPersonalization);
|
||||
string isUserSubjectToGDPR = appsFlyerConsent.isUserSubjectToGDPR?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForDataUsage = appsFlyerConsent.hasConsentForDataUsage?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdsPersonalization = appsFlyerConsent.hasConsentForAdsPersonalization?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdStorage = appsFlyerConsent.hasConsentForAdStorage?.ToString().ToLower() ?? "null";
|
||||
|
||||
appsFlyerAndroid.CallStatic("setConsentData", isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization, hasConsentForAdStorage);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs ad revenue data along with additional parameters if provided.
|
||||
/// <param name = "adRevenueData" >instance of AFAdRevenueData containing ad revenue information.</param>
|
||||
/// <param name = "additionalParameters" >An optional map of additional parameters to be logged with ad revenue data. This can be null if there are no additional parameters.</param>
|
||||
public void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("logAdRevenue", adRevenueData.monetizationNetwork, getMediationNetwork(adRevenueData.mediationNetwork), adRevenueData.currencyIso4217Code, adRevenueData.eventRevenue, convertDictionaryToJavaMap(additionalParameters));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -489,11 +505,11 @@ namespace AppsFlyerSDK
|
||||
/// An af_purchase event with the relevant values will be automatically sent if the validation is successful.
|
||||
/// </summary>
|
||||
/// <param name="details">AFPurchaseDetailsAndroid instance.</param>
|
||||
/// <param name="additionalParameters">additionalParameters Freehand parameters to be sent with the purchase (if validated).</param>
|
||||
public void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject)
|
||||
/// <param name="purchaseAdditionalDetails">purchaseAdditionalDetails Freehand parameters to be sent with the purchase (if validated).</param>
|
||||
public void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("validateAndTrackInAppPurchaseV2", (int)details.purchaseType, details.purchaseToken, details.productId, details.price, details.currency, convertDictionaryToJavaMap(additionalParameters), gameObject ? gameObject.name : null);
|
||||
appsFlyerAndroid.CallStatic("validateAndTrackInAppPurchaseV2", (int)details.purchaseType, details.purchaseToken, details.productId, convertDictionaryToJavaMap(purchaseAdditionalDetails), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -749,6 +765,65 @@ namespace AppsFlyerSDK
|
||||
return emailsCryptType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal Helper Method.
|
||||
/// </summary>
|
||||
private static AndroidJavaObject getMediationNetwork(MediationNetwork mediationNetwork)
|
||||
{
|
||||
AndroidJavaClass mediationNetworkEnumClass = new AndroidJavaClass("com.appsflyer.MediationNetwork");
|
||||
AndroidJavaObject mediationNetworkObject;
|
||||
|
||||
switch (mediationNetwork)
|
||||
{
|
||||
case MediationNetwork.IronSource:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("IRONSOURCE");
|
||||
break;
|
||||
case MediationNetwork.ApplovinMax:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("APPLOVIN_MAX");
|
||||
break;
|
||||
case MediationNetwork.GoogleAdMob:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("GOOGLE_ADMOB");
|
||||
break;
|
||||
case MediationNetwork.Fyber:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("FYBER");
|
||||
break;
|
||||
case MediationNetwork.Appodeal:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("APPODEAL");
|
||||
break;
|
||||
case MediationNetwork.Admost:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("ADMOST");
|
||||
break;
|
||||
case MediationNetwork.Topon:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TOPON");
|
||||
break;
|
||||
case MediationNetwork.Tradplus:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TRADPLUS");
|
||||
break;
|
||||
case MediationNetwork.Yandex:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("YANDEX");
|
||||
break;
|
||||
case MediationNetwork.ChartBoost:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("CHARTBOOST");
|
||||
break;
|
||||
case MediationNetwork.Unity:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("UNITY");
|
||||
break;
|
||||
case MediationNetwork.ToponPte:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TOPON_PTE");
|
||||
break;
|
||||
case MediationNetwork.Custom:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("CUSTOM_MEDIATION");
|
||||
break;
|
||||
case MediationNetwork.DirectMonetization:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("DIRECT_MONETIZATION_NETWORK");
|
||||
break;
|
||||
default:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("NONE");
|
||||
break;
|
||||
}
|
||||
return mediationNetworkObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal Helper Method.
|
||||
/// </summary>
|
||||
@@ -771,9 +846,6 @@ namespace AppsFlyerSDK
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -10,26 +10,45 @@ namespace AppsFlyerSDK
|
||||
// This class should be used to notify and record the user's applicability
|
||||
// under GDPR, their general consent to data usage, and their consent to personalized
|
||||
// advertisements based on user data.
|
||||
|
||||
// Note that the consent for data usage and ads personalization pair is only applicable when the user is
|
||||
// subject to GDPR guidelines. Therefore, the following factory methods should be used accordingly:
|
||||
// - Use [forGDPRUser] when the user is subject to GDPR.
|
||||
// - Use [forNonGDPRUser] when the user is not subject to GDPR.
|
||||
|
||||
// @property isUserSubjectToGDPR Indicates whether GDPR regulations apply to the user (true if the user is
|
||||
// a subject of GDPR). It also serves as a flag for compliance with relevant aspects of DMA regulations.
|
||||
// @property hasConsentForDataUsage Indicates whether the user has consented to the use of their data for advertising
|
||||
// purposes under both GDPR and DMA guidelines (true if the user has consented, nullable if not subject to GDPR).
|
||||
// @property hasConsentForAdsPersonalization Indicates whether the user has consented to the use of their data for
|
||||
// personalized advertising within the boundaries of GDPR and DMA rules (true if the user has consented to
|
||||
// personalized ads, nullable if not subject to GDPR).
|
||||
/// ## Properties:
|
||||
/// - `isUserSubjectToGDPR` (optional) - Indicates whether GDPR regulations apply to the user.
|
||||
/// This may also serve as a general compliance flag for other regional regulations.
|
||||
/// - `hasConsentForDataUsage` (optional) - Indicates whether the user consents to the processing
|
||||
/// of their data for advertising purposes.
|
||||
/// - `hasConsentForAdsPersonalization` (optional) - Indicates whether the user consents to the
|
||||
/// use of their data for personalized advertising.
|
||||
/// - `hasConsentForAdStorage` (optional) - Indicates whether the user consents to ad-related storage access.
|
||||
///
|
||||
/// **Usage Example:**
|
||||
/// ```csharp
|
||||
/// var consent = new AppsFlyerConsent(
|
||||
/// isUserSubjectToGDPR: true,
|
||||
/// hasConsentForDataUsage: true,
|
||||
/// hasConsentForAdsPersonalization: false,
|
||||
/// hasConsentForAdStorage: true
|
||||
/// );
|
||||
/// **Deprecated APIs:**
|
||||
/// - `ForGDPRUser(...)` and `ForNonGDPRUser(...)` should no longer be used.
|
||||
/// - Use `new AppsFlyerConsent(...)` instead with relevant consent fields.
|
||||
///
|
||||
/// </summary>
|
||||
public class AppsFlyerConsent
|
||||
{
|
||||
public bool isUserSubjectToGDPR { get; private set; }
|
||||
public bool hasConsentForDataUsage { get; private set; }
|
||||
public bool hasConsentForAdsPersonalization { get; private set; }
|
||||
public bool? isUserSubjectToGDPR { get; private set; }
|
||||
public bool? hasConsentForDataUsage { get; private set; }
|
||||
public bool? hasConsentForAdsPersonalization { get; private set; }
|
||||
public bool? hasConsentForAdStorage { get; private set; }
|
||||
|
||||
public AppsFlyerConsent( bool? isUserSubjectToGDPR = null, bool? hasConsentForDataUsage = null, bool? hasConsentForAdsPersonalization = null, bool? hasConsentForAdStorage = null)
|
||||
{
|
||||
this.isUserSubjectToGDPR = isUserSubjectToGDPR;
|
||||
this.hasConsentForDataUsage = hasConsentForDataUsage;
|
||||
this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;
|
||||
this.hasConsentForAdStorage = hasConsentForAdStorage;
|
||||
}
|
||||
|
||||
[Obsolete("Use the new constructor with optional booleans instead.")]
|
||||
private AppsFlyerConsent(bool isGDPR, bool hasForDataUsage, bool hasForAdsPersonalization)
|
||||
{
|
||||
isUserSubjectToGDPR = isGDPR;
|
||||
@@ -37,15 +56,16 @@ namespace AppsFlyerSDK
|
||||
hasConsentForAdsPersonalization = hasForAdsPersonalization;
|
||||
}
|
||||
|
||||
[Obsolete("Use new AppsFlyerConsent(...) instead.")]
|
||||
public static AppsFlyerConsent ForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization)
|
||||
{
|
||||
return new AppsFlyerConsent(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);
|
||||
}
|
||||
|
||||
[Obsolete("Use new AppsFlyerConsent(...) instead.")]
|
||||
public static AppsFlyerConsent ForNonGDPRUser()
|
||||
{
|
||||
return new AppsFlyerConsent(false, false, false);
|
||||
return new AppsFlyerConsent(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
426
sdk-intergration/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs
Normal file
426
sdk-intergration/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs
Normal file
@@ -0,0 +1,426 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
public interface IAppsFlyerPurchaseRevenueDataSource
|
||||
{
|
||||
Dictionary<string, object> PurchaseRevenueAdditionalParametersForProducts(HashSet<object> products, HashSet<object> transactions);
|
||||
}
|
||||
|
||||
public interface IAppsFlyerPurchaseRevenueDataSourceStoreKit2
|
||||
{
|
||||
Dictionary<string, object> PurchaseRevenueAdditionalParametersStoreKit2ForProducts(HashSet<object> products, HashSet<object> transactions);
|
||||
}
|
||||
|
||||
public class AppsFlyerPurchaseRevenueBridge : MonoBehaviour
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[DllImport("__Internal")]
|
||||
private static extern void RegisterUnityPurchaseRevenueParamsCallback(Func<string, string, string> callback);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void RegisterUnityPurchaseRevenueParamsCallbackSK2(Func<string, string, string> callback);
|
||||
#endif
|
||||
|
||||
private static IAppsFlyerPurchaseRevenueDataSource _dataSource;
|
||||
private static IAppsFlyerPurchaseRevenueDataSourceStoreKit2 _dataSourceSK2;
|
||||
|
||||
public static void RegisterDataSource(IAppsFlyerPurchaseRevenueDataSource dataSource)
|
||||
{
|
||||
_dataSource = dataSource;
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
RegisterUnityPurchaseRevenueParamsCallback(GetAdditionalParameters);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
using (AndroidJavaClass jc = new AndroidJavaClass("com.appsflyer.unity.PurchaseRevenueBridge"))
|
||||
{
|
||||
jc.CallStatic("setUnityBridge", new UnityPurchaseRevenueBridgeProxy());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void RegisterDataSourceStoreKit2(IAppsFlyerPurchaseRevenueDataSourceStoreKit2 dataSource)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_dataSourceSK2 = dataSource;
|
||||
RegisterUnityPurchaseRevenueParamsCallbackSK2(GetAdditionalParametersSK2);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> GetAdditionalParametersForAndroid(HashSet<object> products, HashSet<object> transactions)
|
||||
{
|
||||
return _dataSource?.PurchaseRevenueAdditionalParametersForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[AOT.MonoPInvokeCallback(typeof(Func<string, string, string>))]
|
||||
public static string GetAdditionalParameters(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(productsJson) as Dictionary<string, object>;
|
||||
if (dict != null)
|
||||
{
|
||||
if (dict.TryGetValue("products", out var productsObj) && productsObj is List<object> productList)
|
||||
products = new HashSet<object>(productList);
|
||||
|
||||
if (dict.TryGetValue("transactions", out var transactionsObj) && transactionsObj is List<object> transactionList)
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
}
|
||||
|
||||
var parameters = _dataSource?.PurchaseRevenueAdditionalParametersForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"[AppsFlyer] Exception in GetAdditionalParameters: {e}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[AOT.MonoPInvokeCallback(typeof(Func<string, string, string>))]
|
||||
public static string GetAdditionalParametersSK2(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(productsJson) as Dictionary<string, object>;
|
||||
if (dict != null && dict.TryGetValue("products", out var productsObj) && productsObj is List<object> productList)
|
||||
products = new HashSet<object>(productList);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(transactionsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(transactionsJson) as Dictionary<string, object>;
|
||||
if (dict != null && dict.TryGetValue("transactions", out var transactionsObj) && transactionsObj is List<object> transactionList)
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
|
||||
var parameters = _dataSourceSK2?.PurchaseRevenueAdditionalParametersStoreKit2ForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"[AppsFlyer] Exception in GetAdditionalParametersSK2: {e}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public class UnityPurchaseRevenueBridgeProxy : AndroidJavaProxy
|
||||
{
|
||||
public UnityPurchaseRevenueBridgeProxy() : base("com.appsflyer.unity.PurchaseRevenueBridge$UnityPurchaseRevenueBridge") { }
|
||||
|
||||
public string getAdditionalParameters(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create empty sets if JSON is null or empty
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
// Only try to parse if we have valid JSON
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
// First try to parse as a simple array
|
||||
var parsedProducts = AFMiniJSON.Json.Deserialize(productsJson);
|
||||
if (parsedProducts is List<object> productList)
|
||||
{
|
||||
products = new HashSet<object>(productList);
|
||||
}
|
||||
else if (parsedProducts is Dictionary<string, object> dict)
|
||||
{
|
||||
if (dict.ContainsKey("events") && dict["events"] is List<object> eventsList)
|
||||
{
|
||||
products = new HashSet<object>(eventsList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If it's a dictionary but doesn't have events, add the whole dict
|
||||
products.Add(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error parsing products JSON: {e.Message}\nJSON: {productsJson}");
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(transactionsJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
// First try to parse as a simple array
|
||||
var parsedTransactions = AFMiniJSON.Json.Deserialize(transactionsJson);
|
||||
if (parsedTransactions is List<object> transactionList)
|
||||
{
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
else if (parsedTransactions is Dictionary<string, object> dict)
|
||||
{
|
||||
if (dict.ContainsKey("events") && dict["events"] is List<object> eventsList)
|
||||
{
|
||||
transactions = new HashSet<object>(eventsList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If it's a dictionary but doesn't have events, add the whole dict
|
||||
transactions.Add(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error parsing transactions JSON: {e.Message}\nJSON: {transactionsJson}");
|
||||
}
|
||||
}
|
||||
|
||||
var parameters = AppsFlyerPurchaseRevenueBridge.GetAdditionalParametersForAndroid(products, transactions);
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error in getAdditionalParameters: {e.Message}\nProducts JSON: {productsJson}\nTransactions JSON: {transactionsJson}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AppsFlyerPurchaseConnector : MonoBehaviour {
|
||||
|
||||
private static AppsFlyerPurchaseConnector instance;
|
||||
private Dictionary<string, object> pendingParameters;
|
||||
private Action<Dictionary<string, object>> pendingCallback;
|
||||
|
||||
public static AppsFlyerPurchaseConnector Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
GameObject go = new GameObject("AppsFlyerPurchaseConnector");
|
||||
instance = go.AddComponent<AppsFlyerPurchaseConnector>();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
private static AndroidJavaClass appsFlyerAndroidConnector = new AndroidJavaClass("com.appsflyer.unity.AppsFlyerAndroidWrapper");
|
||||
#endif
|
||||
|
||||
public static void init(MonoBehaviour unityObject, Store s) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_initPurchaseConnector(unityObject.name);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
int store = mapStoreToInt(s);
|
||||
appsFlyerAndroidConnector.CallStatic("initPurchaseConnector", unityObject ? unityObject.name : null, store);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void build() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
//not for iOS
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("build");
|
||||
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void startObservingTransactions() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_startObservingTransactions();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("startObservingTransactions");
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void stopObservingTransactions() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_stopObservingTransactions();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("stopObservingTransactions");
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setIsSandbox(bool isSandbox) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setIsSandbox(isSandbox);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("setIsSandbox", isSandbox);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setPurchaseRevenueValidationListeners(bool enableCallbacks) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setPurchaseRevenueDelegate();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("setPurchaseRevenueValidationListeners", enableCallbacks);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setAutoLogPurchaseRevenue(params AppsFlyerAutoLogPurchaseRevenueOptions[] autoLogPurchaseRevenueOptions) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
int option = 0;
|
||||
foreach (AppsFlyerAutoLogPurchaseRevenueOptions op in autoLogPurchaseRevenueOptions) {
|
||||
option = option | (int)op;
|
||||
}
|
||||
_setAutoLogPurchaseRevenue(option);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
if (autoLogPurchaseRevenueOptions.Length == 0) {
|
||||
return;
|
||||
}
|
||||
foreach (AppsFlyerAutoLogPurchaseRevenueOptions op in autoLogPurchaseRevenueOptions) {
|
||||
switch(op) {
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsDisabled:
|
||||
break;
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions:
|
||||
appsFlyerAndroidConnector.CallStatic("setAutoLogSubscriptions", true);
|
||||
break;
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsInAppPurchases:
|
||||
appsFlyerAndroidConnector.CallStatic("setAutoLogInApps", true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setPurchaseRevenueDataSource(IAppsFlyerPurchaseRevenueDataSource dataSource)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
if (dataSource != null)
|
||||
{
|
||||
_setPurchaseRevenueDataSource(dataSource.GetType().Name);
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSource(dataSource);
|
||||
}
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
if (dataSource != null)
|
||||
{
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSource(dataSource);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static void setPurchaseRevenueDataSourceStoreKit2(IAppsFlyerPurchaseRevenueDataSourceStoreKit2 dataSourceSK2)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
if (dataSourceSK2 != null)
|
||||
{
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSourceStoreKit2(dataSourceSK2);
|
||||
_setPurchaseRevenueDataSource("AppsFlyerObjectScript_StoreKit2");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private static int mapStoreToInt(Store s) {
|
||||
switch(s) {
|
||||
case(Store.GOOGLE):
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setStoreKitVersion(StoreKitVersion storeKitVersion) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setStoreKitVersion((int)storeKitVersion);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android doesn't use StoreKit
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void logConsumableTransaction(string transactionJson) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_logConsumableTransaction(transactionJson);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android doesn't use StoreKit
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _startObservingTransactions();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _stopObservingTransactions();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setIsSandbox(bool isSandbox);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setPurchaseRevenueDelegate();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setPurchaseRevenueDataSource(string dataSourceName);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setAutoLogPurchaseRevenue(int option);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _initPurchaseConnector(string objectName);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setStoreKitVersion(int storeKitVersion);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _logConsumableTransaction(string transactionJson);
|
||||
|
||||
#endif
|
||||
}
|
||||
public enum Store {
|
||||
GOOGLE = 0
|
||||
}
|
||||
public enum AppsFlyerAutoLogPurchaseRevenueOptions
|
||||
{
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsDisabled = 0,
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions = 1 << 0,
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsInAppPurchases = 1 << 1
|
||||
}
|
||||
|
||||
public enum StoreKitVersion {
|
||||
SK1 = 0,
|
||||
SK2 = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0636ea07d370d437183f3762280c08ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -215,7 +215,24 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
public void setConsentData(AppsFlyerConsent appsFlyerConsent)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_setConsentData(appsFlyerConsent.isUserSubjectToGDPR, appsFlyerConsent.hasConsentForDataUsage, appsFlyerConsent.hasConsentForAdsPersonalization);
|
||||
string isUserSubjectToGDPR = appsFlyerConsent.isUserSubjectToGDPR?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForDataUsage = appsFlyerConsent.hasConsentForDataUsage?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdsPersonalization = appsFlyerConsent.hasConsentForAdsPersonalization?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdStorage = appsFlyerConsent.hasConsentForAdStorage?.ToString().ToLower() ?? "null";
|
||||
|
||||
_setConsentData(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization, hasConsentForAdStorage);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs ad revenue data along with additional parameters if provided.
|
||||
/// </summary>
|
||||
/// <param name = "adRevenueData" >instance of AFAdRevenueData containing ad revenue information.</param>
|
||||
/// <param name = "additionalParameters" >An optional map of additional parameters to be logged with ad revenue data. This can be null if there are no additional parameters.</param>
|
||||
public void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_logAdRevenue(adRevenueData.monetizationNetwork, adRevenueData.mediationNetwork, adRevenueData.currencyIso4217Code, adRevenueData.eventRevenue, AFMiniJSON.Json.Serialize(additionalParameters));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -337,11 +354,11 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
/// To send and validate in app purchases you can call this method from the processPurchase method.
|
||||
/// </summary>
|
||||
/// <param name="details">The AFSDKPurchaseDetailsIOS instance.</param>
|
||||
/// <param name="extraEventValues">The extra params, which you want to receive it in the raw reports.</param>
|
||||
public void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> extraEventValues, MonoBehaviour gameObject)
|
||||
/// <param name="purchaseAdditionalDetails">The additional params, which you want to receive it in the raw reports.</param>
|
||||
public void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_validateAndSendInAppPurchaseV2(details.productId, details.price, details.currency, details.transactionId, AFMiniJSON.Json.Serialize(extraEventValues), gameObject ? gameObject.name : null);
|
||||
_validateAndSendInAppPurchaseV2(details.productId, details.transactionId, (int)details.purchaseType, AFMiniJSON.Json.Serialize(purchaseAdditionalDetails), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -748,7 +765,14 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _setConsentData(bool isUserSubjectToGDPR, bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization);
|
||||
private static extern void _setConsentData(string isUserSubjectToGDPR, string hasConsentForDataUsage, string hasConsentForAdsPersonalization, string hasConsentForAdStorage);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _logAdRevenue(string monetizationNetwork, MediationNetwork mediationNetwork, string currencyIso4217Code, double eventRevenue, string additionalParameters);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
@@ -819,7 +843,7 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _validateAndSendInAppPurchaseV2(string product, string price, string currency, string transactionId, string extraEventValues, string objectName);
|
||||
private static extern void _validateAndSendInAppPurchaseV2(string product, string transactionId, int purchaseType, string purchaseAdditionalDetails, string objectName);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.appsflyer:adrevenue:6.9.1"></androidPackage>
|
||||
<androidPackage spec="com.appsflyer:unity-adrevenue-generic-wrapper:6.9.1"></androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<iosPods>
|
||||
<iosPod name="AppsFlyer-AdRevenue" version="6.14.3" minTargetSdk="12.0">
|
||||
</iosPod>
|
||||
</iosPods>
|
||||
|
||||
</dependencies>
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6110ce30bf7674268814dc9e0395f8b0
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,17 +2,15 @@
|
||||
<dependencies>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.appsflyer:af-android-sdk:6.14.0">
|
||||
</androidPackage>
|
||||
<androidPackage spec="com.appsflyer:unity-wrapper:6.14.3">
|
||||
</androidPackage>
|
||||
<androidPackage spec="com.android.installreferrer:installreferrer:2.1">
|
||||
</androidPackage>
|
||||
<androidPackage spec="com.appsflyer:af-android-sdk:6.17.3"></androidPackage>
|
||||
<androidPackage spec="com.appsflyer:unity-wrapper:6.17.7"></androidPackage>
|
||||
<androidPackage spec="com.android.installreferrer:installreferrer:2.1"></androidPackage>
|
||||
<androidPackage spec="com.appsflyer:purchase-connector:2.2.0"></androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<iosPods>
|
||||
<iosPod name="AppsFlyerFramework" version="6.14.3" minTargetSdk="12.0">
|
||||
</iosPod>
|
||||
<iosPod name="AppsFlyerFramework" version="6.17.7" minTargetSdk="12.0"></iosPod>
|
||||
<iosPod name="PurchaseConnector" version="6.17.7" minTargetSdk="12.0"></iosPod>
|
||||
</iosPods>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace AppsFlyerSDK
|
||||
string getAttributionId();
|
||||
void handlePushNotifications();
|
||||
void validateAndSendInAppPurchase(string publicKey, string signature, string purchaseData, string price, string currency, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject);
|
||||
void setCollectOaid(bool isCollect);
|
||||
void setDisableAdvertisingIdentifiers(bool disable);
|
||||
void setDisableNetworkData(bool disable);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AppsFlyerSDK
|
||||
void setUseReceiptValidationSandbox(bool useReceiptValidationSandbox);
|
||||
void setUseUninstallSandbox(bool useUninstallSandbox);
|
||||
void validateAndSendInAppPurchase(string productIdentifier, string price, string currency, string transactionId, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> extraEventValues, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject);
|
||||
void registerUninstall(byte[] deviceToken);
|
||||
void handleOpenUrl(string url, string sourceApplication, string annotation);
|
||||
void waitForATTUserAuthorizationWithTimeoutInterval(int timeoutInterval);
|
||||
|
||||
@@ -43,6 +43,8 @@ namespace AppsFlyerSDK
|
||||
|
||||
void setConsentData(AppsFlyerConsent appsFlyerConsent);
|
||||
|
||||
void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters);
|
||||
|
||||
void setMinTimeBetweenSessions(int seconds);
|
||||
|
||||
void setHost(string hostPrefixName, string hostName);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public interface IAppsFlyerPurchaseValidation
|
||||
{
|
||||
void didReceivePurchaseRevenueValidationInfo(string validationInfo);
|
||||
void didReceivePurchaseRevenueError(string error);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c60f499ae0d048b1be8ffd6878a184c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28175da64865f4e398b3b9ddfbe97b24
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58a86b0b376564c06bf8ce29e1dbfb04
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 218a2e7ff5a4c461981bc41f7d7bfeba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
0
sdk-intergration/Assets/AppsFlyer/Mac/AppsFlyerBundle.bundle/Contents/MacOS/AppsFlyerBundle
Normal file → Executable file
0
sdk-intergration/Assets/AppsFlyer/Mac/AppsFlyerBundle.bundle/Contents/MacOS/AppsFlyerBundle
Normal file → Executable file
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0889edee891d84a8eb0b7cc87071b91e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16068f30788004029bd487756623799b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 724b52b308e9a4a6d889d7bf3945a2ca
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
import Foundation
|
||||
import StoreKit
|
||||
|
||||
#if canImport(PurchaseConnector)
|
||||
import PurchaseConnector
|
||||
|
||||
@available(iOS 15.0, *)
|
||||
@objc
|
||||
public class AFUnityStoreKit2Bridge: NSObject {
|
||||
@objc
|
||||
public static func fetchAFSDKTransactionSK2(withTransactionId transactionId: String, completion: @escaping (AFSDKTransactionSK2?) -> Void) {
|
||||
guard let transactionIdUInt64 = UInt64(transactionId) else {
|
||||
print("Invalid transaction ID format.")
|
||||
completion(nil)
|
||||
return
|
||||
}
|
||||
Task {
|
||||
for await result in StoreKit.Transaction.all {
|
||||
if case .verified(let transaction) = result, transaction.id == transactionIdUInt64 {
|
||||
let afTransaction = AFSDKTransactionSK2(transaction: transaction)
|
||||
DispatchQueue.main.async {
|
||||
completion(afTransaction)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
completion(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public static func extractSK2ProductInfo(_ products: [AFSDKProductSK2]) -> NSArray {
|
||||
var result: [[String: Any]] = []
|
||||
|
||||
for product in products {
|
||||
if let swiftProduct = Mirror(reflecting: product).children.first(where: { $0.label == "product" })?.value {
|
||||
let productId = (swiftProduct as? NSObject)?.value(forKey: "id") as? String ?? ""
|
||||
let title = (swiftProduct as? NSObject)?.value(forKey: "displayName") as? String ?? ""
|
||||
let desc = (swiftProduct as? NSObject)?.value(forKey: "description") as? String ?? ""
|
||||
let price = (swiftProduct as? NSObject)?.value(forKey: "price") as? NSDecimalNumber ?? 0
|
||||
|
||||
result.append([
|
||||
"productIdentifier": productId,
|
||||
"localizedTitle": title,
|
||||
"localizedDescription": desc,
|
||||
"price": price
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
return result as NSArray
|
||||
}
|
||||
|
||||
@objc
|
||||
public static func extractSK2TransactionInfo(_ transactions: [AFSDKTransactionSK2]) -> NSArray {
|
||||
var result: [[String: Any]] = []
|
||||
|
||||
for txn in transactions {
|
||||
guard let mirrorChild = Mirror(reflecting: txn).children.first(where: { $0.label == "transaction" }),
|
||||
let swiftTxn = mirrorChild.value as? StoreKit.Transaction else {
|
||||
continue
|
||||
}
|
||||
|
||||
let transactionId = "\(swiftTxn.id)"
|
||||
let date = NSNumber(value: swiftTxn.purchaseDate.timeIntervalSince1970)
|
||||
|
||||
result.append([
|
||||
"transactionIdentifier": transactionId,
|
||||
"transactionState": "verified", // or skip this line
|
||||
"transactionDate": date
|
||||
])
|
||||
}
|
||||
|
||||
return result as NSArray
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5652805602a6b4273a6e527b00aea272
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
VisionOS: VisionOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -17,6 +17,8 @@ static NSArray<NSString*> *NSArrayFromCArray(int length, const char **arr);
|
||||
static char* getCString(const char* string);
|
||||
static AppsFlyerLinkGenerator* generatorFromDictionary(NSDictionary* dictionary, AppsFlyerLinkGenerator* generator);
|
||||
static EmailCryptType emailCryptTypeFromInt(int emailCryptTypeInt);
|
||||
static AppsFlyerAdRevenueMediationNetworkType mediationNetworkTypeFromInt(int mediationNetwork);
|
||||
static NSNumber *intFromNullableBool(const char *cStr);
|
||||
static NSString* stringFromDeepLinkResultStatus(AFSDKDeepLinkResultStatus deepLinkResult);
|
||||
static NSString* stringFromDeepLinkResultError(AppsFlyerDeepLinkResult *result);
|
||||
|
||||
|
||||
@@ -108,6 +108,72 @@ static EmailCryptType emailCryptTypeFromInt(int emailCryptTypeInt){
|
||||
return emailCryptType;
|
||||
}
|
||||
|
||||
static NSNumber *intFromNullableBool(const char *cStr) {
|
||||
if (!cStr) return nil;
|
||||
NSString *str = [NSString stringWithUTF8String:cStr];
|
||||
|
||||
if ([str caseInsensitiveCompare:@"true"] == NSOrderedSame) {
|
||||
return @YES;
|
||||
} else if ([str caseInsensitiveCompare:@"false"] == NSOrderedSame) {
|
||||
return @NO;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static AppsFlyerAdRevenueMediationNetworkType mediationNetworkTypeFromInt(int mediationNetworkInt){
|
||||
|
||||
AppsFlyerAdRevenueMediationNetworkType mediationNetworkType;
|
||||
switch (mediationNetworkInt){
|
||||
case 1:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob;
|
||||
break;
|
||||
case 2:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeIronSource;
|
||||
break;
|
||||
case 3:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeApplovinMax;
|
||||
break;
|
||||
case 4:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeFyber;
|
||||
break;
|
||||
case 5:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeAppodeal;
|
||||
break;
|
||||
case 6:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeAdmost;
|
||||
break;
|
||||
case 7:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeTopon;
|
||||
break;
|
||||
case 8:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeTradplus;
|
||||
break;
|
||||
case 9:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeYandex;
|
||||
break;
|
||||
case 10:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeChartBoost;
|
||||
break;
|
||||
case 11:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeUnity;
|
||||
break;
|
||||
case 12:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeToponPte;
|
||||
break;
|
||||
case 13:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeCustom;
|
||||
break;
|
||||
case 14:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeDirectMonetization;
|
||||
break;
|
||||
default:
|
||||
mediationNetworkType = AppsFlyerAdRevenueMediationNetworkTypeCustom;
|
||||
break;
|
||||
}
|
||||
|
||||
return mediationNetworkType;
|
||||
}
|
||||
|
||||
static NSString* stringFromDeepLinkResultStatus(AFSDKDeepLinkResultStatus deepLinkResult){
|
||||
NSString* result;
|
||||
switch (deepLinkResult){
|
||||
|
||||
@@ -29,6 +29,34 @@ static IMP __original_openUrl_Imp __unused;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
||||
#if !AFSDK_SHOULD_SWIZZLE
|
||||
|
||||
id swizzleFlag = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"AppsFlyerShouldSwizzle"];
|
||||
BOOL shouldSwizzle = swizzleFlag ? [swizzleFlag boolValue] : NO;
|
||||
|
||||
if(shouldSwizzle){
|
||||
|
||||
Method method1 = class_getInstanceMethod([self class], @selector(applicationDidBecomeActive:));
|
||||
__original_applicationDidBecomeActive_Imp = method_setImplementation(method1, (IMP)__swizzled_applicationDidBecomeActive);
|
||||
|
||||
Method method2 = class_getInstanceMethod([self class], @selector(applicationDidEnterBackground:));
|
||||
__original_applicationDidEnterBackground_Imp = method_setImplementation(method2, (IMP)__swizzled_applicationDidEnterBackground);
|
||||
|
||||
|
||||
Method method3 = class_getInstanceMethod([self class], @selector(didReceiveRemoteNotification:));
|
||||
__original_didReceiveRemoteNotification_Imp = method_setImplementation(method3, (IMP)__swizzled_didReceiveRemoteNotification);
|
||||
|
||||
|
||||
Method method4 = class_getInstanceMethod([self class], @selector(application:openURL:options:));
|
||||
__original_openUrl_Imp = method_setImplementation(method4, (IMP)__swizzled_openURL);
|
||||
|
||||
if (_AppsFlyerdelegate == nil) {
|
||||
_AppsFlyerdelegate = [[AppsFlyeriOSWarpper alloc] init];
|
||||
}
|
||||
|
||||
[self swizzleContinueUserActivity:[self class]];
|
||||
}
|
||||
#elif AFSDK_SHOULD_SWIZZLE
|
||||
Method method1 = class_getInstanceMethod([self class], @selector(applicationDidBecomeActive:));
|
||||
__original_applicationDidBecomeActive_Imp = method_setImplementation(method1, (IMP)__swizzled_applicationDidBecomeActive);
|
||||
|
||||
@@ -48,6 +76,10 @@ static IMP __original_openUrl_Imp __unused;
|
||||
}
|
||||
|
||||
[self swizzleContinueUserActivity:[self class]];
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// AppsFlyerAdRevenueWrapper.h
|
||||
// Unity-iPhone
|
||||
//
|
||||
// Created by Jonathan Wesfield on 01/12/2019.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppsFlyerAdRevenue/AppsFlyerAdRevenue.h>)
|
||||
#import <AppsFlyerAdRevenue/AppsFlyerAdRevenue.h>
|
||||
#endif
|
||||
|
||||
@interface AppsFlyerAdRevenueWrapper : NSObject
|
||||
|
||||
@end
|
||||
@@ -1,27 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fa891a95d71c459daa1e92ee7a653ab
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// AppsFlyerAdRevenueWrapper.mm
|
||||
// Unity-iPhone
|
||||
//
|
||||
// Created by Jonathan Wesfield on 25/11/2019.
|
||||
//
|
||||
|
||||
#import "AppsFlyerAdRevenueWrapper.h"
|
||||
|
||||
|
||||
@implementation AppsFlyerAdRevenueWrapper
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
NSString* stringFromChar(const char *str) {
|
||||
return str ? [NSString stringWithUTF8String:str] : nil;
|
||||
}
|
||||
|
||||
NSDictionary* dictionaryFromJson(const char *jsonString) {
|
||||
if(jsonString){
|
||||
NSData *jsonData = [[NSData alloc] initWithBytes:jsonString length:strlen(jsonString)];
|
||||
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:nil];
|
||||
return dictionary;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
const void _start(int length, int* adRevenueTypes){
|
||||
[AppsFlyerAdRevenue start];
|
||||
}
|
||||
const void _setIsDebugAdrevenue(bool isDebug){
|
||||
[[AppsFlyerAdRevenue shared] setIsDebug:isDebug];
|
||||
}
|
||||
|
||||
const void _logAdRevenue(const char* monetizationNetwork,
|
||||
int mediationNetwork,
|
||||
double eventRevenue,
|
||||
const char* revenueCurrency,
|
||||
const char* additionalParameters){
|
||||
[[AppsFlyerAdRevenue shared] logAdRevenueWithMonetizationNetwork:stringFromChar(monetizationNetwork)
|
||||
mediationNetwork:(AppsFlyerAdRevenueMediationNetworkType) mediationNetwork
|
||||
eventRevenue:[NSNumber numberWithDouble:eventRevenue]
|
||||
revenueCurrency:stringFromChar(revenueCurrency)
|
||||
additionalParameters:dictionaryFromJson(additionalParameters)];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,37 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84d99cf0f930e4c80b4bc1858e042b70
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -101,6 +101,11 @@
|
||||
|
||||
@end
|
||||
|
||||
#if !(AFSDK_SHOULD_SWIZZLE)
|
||||
|
||||
IMPL_APP_CONTROLLER_SUBCLASS(AppsFlyerAppController)
|
||||
|
||||
#endif
|
||||
/**
|
||||
Note if you would not like to use IMPL_APP_CONTROLLER_SUBCLASS you can replace it with the code below.
|
||||
<code>
|
||||
|
||||
@@ -13,10 +13,27 @@
|
||||
#else
|
||||
#import "AppsFlyerLib.h"
|
||||
#endif
|
||||
#if __has_include(<PurchaseConnector/PurchaseConnector.h>)
|
||||
#import <PurchaseConnector/PurchaseConnector.h>
|
||||
#else
|
||||
#import "PurchaseConnector.h"
|
||||
#endif
|
||||
#import <PurchaseConnector/PurchaseConnector-Swift.h>
|
||||
|
||||
// Add StoreKit 2 support
|
||||
#if __has_include(<StoreKit/StoreKit.h>)
|
||||
#import <StoreKit/StoreKit.h>
|
||||
#endif
|
||||
|
||||
@interface AppsFlyeriOSWarpper : NSObject <AppsFlyerLibDelegate, AppsFlyerDeepLinkDelegate, AppsFlyerPurchaseRevenueDelegate, AppsFlyerPurchaseRevenueDataSource, AppsFlyerPurchaseRevenueDataSourceStoreKit2>
|
||||
|
||||
@interface AppsFlyeriOSWarpper : NSObject <AppsFlyerLibDelegate, AppsFlyerDeepLinkDelegate>
|
||||
+ (BOOL) didCallStart;
|
||||
+ (void) setDidCallStart:(BOOL)val;
|
||||
|
||||
// Add StoreKit 2 methods
|
||||
- (void)setStoreKitVersion:(int)storeKitVersion;
|
||||
- (void)logConsumableTransaction:(id)transaction;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -48,3 +65,7 @@ static NSString* startRequestObjectName = @"";
|
||||
static NSString* inAppRequestObjectName = @"";
|
||||
static NSString* onDeeplinkingObjectName = @"";
|
||||
|
||||
static const char* PURCHASE_REVENUE_VALIDATION_CALLBACK = "didReceivePurchaseRevenueValidationInfo";
|
||||
static const char* PURCHASE_REVENUE_ERROR_CALLBACK = "didReceivePurchaseRevenueError";
|
||||
|
||||
static NSString* onPurchaseValidationObjectName = @"";
|
||||
|
||||
@@ -6,7 +6,22 @@
|
||||
//
|
||||
|
||||
#import "AppsFlyeriOSWrapper.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
#import <StoreKit/StoreKit.h>
|
||||
#import "UnityFramework/UnityFramework-Swift.h"
|
||||
|
||||
#if __has_include(<PurchaseConnector/PurchaseConnector-Swift.h>)
|
||||
#import <PurchaseConnector/PurchaseConnector-Swift.h>
|
||||
#elif __has_include("PurchaseConnector-Swift.h")
|
||||
#import "PurchaseConnector-Swift.h"
|
||||
#endif
|
||||
|
||||
#if __has_include(<UnityFramework/UnityFramework-Swift.h>)
|
||||
#import <UnityFramework/UnityFramework-Swift.h>
|
||||
#elif __has_include("UnityFramework-Swift.h")
|
||||
#import "UnityFramework-Swift.h"
|
||||
#endif
|
||||
|
||||
static void unityCallBack(NSString* objectName, const char* method, const char* msg) {
|
||||
if(objectName){
|
||||
@@ -18,7 +33,7 @@ extern "C" {
|
||||
|
||||
const void _startSDK(bool shouldCallback, const char* objectName) {
|
||||
[[AppsFlyerLib shared] setPluginInfoWith: AFSDKPluginUnity
|
||||
pluginVersion:@"6.14.3"
|
||||
pluginVersion:@"6.17.7"
|
||||
additionalParams:nil];
|
||||
startRequestObjectName = stringFromChar(objectName);
|
||||
AppsFlyeriOSWarpper.didCallStart = YES;
|
||||
@@ -87,14 +102,26 @@ extern "C" {
|
||||
[[AppsFlyerLib shared] enableTCFDataCollection:shouldCollectTcfData];
|
||||
}
|
||||
|
||||
const void _setConsentData(bool isUserSubjectToGDPR, bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization) {
|
||||
AppsFlyerConsent *consentData = nil;
|
||||
if (isUserSubjectToGDPR) {
|
||||
consentData = [[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:hasConsentForDataUsage hasConsentForAdsPersonalization:hasConsentForAdsPersonalization];
|
||||
} else {
|
||||
consentData = [[AppsFlyerConsent alloc] initNonGDPRUser];
|
||||
}
|
||||
[[AppsFlyerLib shared] setConsentData:consentData];
|
||||
const void _setConsentData(const char* isUserSubjectToGDPR, const char* hasConsentForDataUsage, const char* hasConsentForAdsPersonalization, const char* hasConsentForAdStorage) {
|
||||
|
||||
NSNumber *gdpr = intFromNullableBool(isUserSubjectToGDPR);
|
||||
NSNumber *dataUsage = intFromNullableBool(hasConsentForDataUsage);
|
||||
NSNumber *adsPersonalization = intFromNullableBool(hasConsentForAdsPersonalization);
|
||||
NSNumber *adStorage = intFromNullableBool(hasConsentForAdStorage);
|
||||
|
||||
AppsFlyerConsent *consentData = [[AppsFlyerConsent alloc] initWithIsUserSubjectToGDPR:gdpr
|
||||
hasConsentForDataUsage:dataUsage
|
||||
hasConsentForAdsPersonalization:adsPersonalization
|
||||
hasConsentForAdStorage:adStorage];
|
||||
|
||||
[[AppsFlyerLib shared] setConsentData:consentData];
|
||||
}
|
||||
|
||||
const void _logAdRevenue(const char* monetizationNetwork, int mediationNetworkInt, const char* currencyIso4217Code, double eventRevenue, const char* additionalParameters) {
|
||||
AppsFlyerAdRevenueMediationNetworkType mediationNetwork = mediationNetworkTypeFromInt(mediationNetworkInt);
|
||||
NSNumber *number = [NSNumber numberWithDouble:eventRevenue];
|
||||
AFAdRevenueData *adRevenue = [[AFAdRevenueData alloc] initWithMonetizationNetwork:stringFromChar(monetizationNetwork) mediationNetwork:mediationNetwork currencyIso4217Code:stringFromChar(currencyIso4217Code) eventRevenue:number];
|
||||
[[AppsFlyerLib shared] logAdRevenue: adRevenue additionalParameters:dictionaryFromJson(additionalParameters)];
|
||||
}
|
||||
|
||||
const void _setDisableCollectIAd (bool disableCollectASA) {
|
||||
@@ -261,21 +288,38 @@ extern "C" {
|
||||
}];
|
||||
}
|
||||
|
||||
const void _validateAndSendInAppPurchaseV2 (const char* product, const char* price, const char* currency, const char* transactionId, const char* extraEventValues, const char* objectName) {
|
||||
const void _validateAndSendInAppPurchaseV2 (const char* product, const char* transactionId, int purchaseType, const char* purchaseAdditionalDetails, const char* objectName) {
|
||||
|
||||
validateAndLogObjectName = stringFromChar(objectName);
|
||||
AFSDKPurchaseDetails *details = [[AFSDKPurchaseDetails alloc] initWithProductId:stringFromChar(product) price:stringFromChar(price) currency:stringFromChar(currency) transactionId:stringFromChar(transactionId)];
|
||||
AFSDKPurchaseDetails *details = [[AFSDKPurchaseDetails alloc] initWithProductId:stringFromChar(product) transactionId:stringFromChar(transactionId) purchaseType:(AFSDKPurchaseType)purchaseType];
|
||||
|
||||
[[AppsFlyerLib shared]
|
||||
validateAndLogInAppPurchase:details
|
||||
extraEventValues:dictionaryFromJson(extraEventValues)
|
||||
completionHandler:^(AFSDKValidateAndLogResult * _Nullable result) {
|
||||
if (result.status == AFSDKValidateAndLogStatusSuccess) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(result.result));
|
||||
} else if (result.status == AFSDKValidateAndLogStatusFailure) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(result.errorData));
|
||||
purchaseAdditionalDetails:dictionaryFromJson(purchaseAdditionalDetails)
|
||||
completion:^(NSDictionary * _Nullable response, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_ERROR_CALLBACK, stringFromdictionary(dictionaryFromNSError(error)));
|
||||
} else {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_ERROR_CALLBACK, stringFromdictionary(dictionaryFromNSError(result.error)));
|
||||
// Check if the response indicates validation failure
|
||||
BOOL isValidationFailure = NO;
|
||||
if (response && [response isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *resultDict = response[@"result"];
|
||||
if (resultDict && [resultDict isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *responseForProduct = resultDict.allValues.firstObject;
|
||||
if (responseForProduct && [responseForProduct isKindOfClass:[NSDictionary class]]) {
|
||||
BOOL validationResult = [responseForProduct[@"result"] boolValue];
|
||||
if (!validationResult) {
|
||||
isValidationFailure = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isValidationFailure) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_ERROR_CALLBACK, stringFromdictionary(response));
|
||||
} else {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(response));
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
@@ -325,6 +369,97 @@ extern "C" {
|
||||
[AppsFlyerLib shared].disableIDFVCollection = isDisabled;
|
||||
}
|
||||
|
||||
// Purchase connector
|
||||
const void _startObservingTransactions() {
|
||||
[[PurchaseConnector shared] startObservingTransactions];
|
||||
}
|
||||
|
||||
const void _stopObservingTransactions() {
|
||||
[[PurchaseConnector shared] stopObservingTransactions];
|
||||
}
|
||||
|
||||
const void _setIsSandbox(bool isSandBox) {
|
||||
[[PurchaseConnector shared] setIsSandbox:isSandBox];
|
||||
}
|
||||
|
||||
const void _setPurchaseRevenueDelegate() {
|
||||
if (_AppsFlyerdelegate== nil) {
|
||||
_AppsFlyerdelegate = [[AppsFlyeriOSWarpper alloc] init];
|
||||
}
|
||||
[[PurchaseConnector shared] setPurchaseRevenueDelegate:_AppsFlyerdelegate];
|
||||
}
|
||||
|
||||
const void _setAutoLogPurchaseRevenue(int option) {
|
||||
[[PurchaseConnector shared] setAutoLogPurchaseRevenue:option];
|
||||
|
||||
}
|
||||
|
||||
const void _initPurchaseConnector(const char* objectName) {
|
||||
if (_AppsFlyerdelegate == nil) {
|
||||
_AppsFlyerdelegate = [[AppsFlyeriOSWarpper alloc] init];
|
||||
}
|
||||
onPurchaseValidationObjectName = stringFromChar(objectName);
|
||||
}
|
||||
|
||||
const void _setPurchaseRevenueDataSource(const char* objectName) {
|
||||
if (_AppsFlyerdelegate == nil) {
|
||||
_AppsFlyerdelegate = [[AppsFlyeriOSWarpper alloc] init];
|
||||
}
|
||||
|
||||
if (strstr(objectName, "StoreKit2") != NULL) {
|
||||
|
||||
// Force protocol conformance
|
||||
Protocol *sk2Protocol = @protocol(AppsFlyerPurchaseRevenueDataSourceStoreKit2);
|
||||
class_addProtocol([_AppsFlyerdelegate class], sk2Protocol);
|
||||
|
||||
if (![_AppsFlyerdelegate conformsToProtocol:@protocol(AppsFlyerPurchaseRevenueDataSourceStoreKit2)]) {
|
||||
NSLog(@"[AppsFlyer] Warning: SK2 protocol not conformed!");
|
||||
}
|
||||
}
|
||||
|
||||
[PurchaseConnector shared].purchaseRevenueDataSource = _AppsFlyerdelegate;
|
||||
}
|
||||
|
||||
const void _setStoreKitVersion(int storeKitVersion) {
|
||||
[[PurchaseConnector shared] setStoreKitVersion:(AFSDKStoreKitVersion)storeKitVersion];
|
||||
}
|
||||
|
||||
const void _logConsumableTransaction(const char* transactionId) {
|
||||
if (@available(iOS 15.0, *)) {
|
||||
NSString *transactionIdStr = [NSString stringWithUTF8String:transactionId];
|
||||
[AFUnityStoreKit2Bridge fetchAFSDKTransactionSK2WithTransactionId:transactionIdStr completion:^(AFSDKTransactionSK2 *afTransaction) {
|
||||
if (afTransaction) {
|
||||
[[PurchaseConnector shared] logConsumableTransaction:afTransaction];
|
||||
} else {
|
||||
NSLog(@"No AFSDKTransactionSK2 found for id %@", transactionIdStr);
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef const char *(*UnityPurchaseCallback)(const char *, const char *);
|
||||
|
||||
UnityPurchaseCallback UnityPurchasesGetAdditionalParamsCallback = NULL;
|
||||
UnityPurchaseCallback UnityPurchasesGetAdditionalParamsCallbackSK2 = NULL;
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
void RegisterUnityPurchaseRevenueParamsCallback(UnityPurchaseCallback callback) {
|
||||
UnityPurchasesGetAdditionalParamsCallback = callback;
|
||||
}
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
void RegisterUnityPurchaseRevenueParamsCallbackSK2(UnityPurchaseCallback callback) {
|
||||
UnityPurchasesGetAdditionalParamsCallbackSK2 = callback;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@implementation AppsFlyeriOSWarpper
|
||||
@@ -366,5 +501,120 @@ static BOOL didCallStart;
|
||||
unityCallBack(onDeeplinkingObjectName, ON_DEEPLINKING, stringFromdictionary(dict));
|
||||
}
|
||||
|
||||
// Purchase Connector
|
||||
- (void)didReceivePurchaseRevenueValidationInfo:(NSDictionary *)validationInfo error:(NSError *)error {
|
||||
if (error != nil) {
|
||||
unityCallBack(onPurchaseValidationObjectName, PURCHASE_REVENUE_ERROR_CALLBACK, [[error localizedDescription] UTF8String]);
|
||||
} else {
|
||||
unityCallBack(onPurchaseValidationObjectName, PURCHASE_REVENUE_VALIDATION_CALLBACK, stringFromdictionary(validationInfo));
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDictionary *)purchaseRevenueAdditionalParametersForProducts:(NSSet<SKProduct *> *)products
|
||||
transactions:(NSSet<SKPaymentTransaction *> *)transactions {
|
||||
|
||||
NSMutableArray *productsArray = [NSMutableArray array];
|
||||
for (SKProduct *product in products) {
|
||||
[productsArray addObject:@{
|
||||
@"productIdentifier": product.productIdentifier ?: @"",
|
||||
@"localizedTitle": product.localizedTitle ?: @"",
|
||||
@"localizedDescription": product.localizedDescription ?: @"",
|
||||
@"price": [product.price stringValue] ?: @""
|
||||
}];
|
||||
}
|
||||
|
||||
NSMutableArray *transactionsArray = [NSMutableArray array];
|
||||
for (SKPaymentTransaction *txn in transactions) {
|
||||
[transactionsArray addObject:@{
|
||||
@"transactionIdentifier": txn.transactionIdentifier ?: @"",
|
||||
@"transactionState": @(txn.transactionState),
|
||||
@"transactionDate": txn.transactionDate ? [@(txn.transactionDate.timeIntervalSince1970) stringValue] : @""
|
||||
}];
|
||||
}
|
||||
|
||||
NSDictionary *input = @{
|
||||
@"products": productsArray,
|
||||
@"transactions": transactionsArray
|
||||
};
|
||||
|
||||
NSError *error = nil;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:input options:0 error:&error];
|
||||
if (error || !jsonData) {
|
||||
NSLog(@"[AppsFlyer] Failed to serialize Unity purchase data: %@", error);
|
||||
return @{};
|
||||
}
|
||||
|
||||
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
if (!jsonString || !UnityPurchasesGetAdditionalParamsCallback) {
|
||||
NSLog(@"[AppsFlyer] Unity callback not registered");
|
||||
return @{};
|
||||
}
|
||||
|
||||
const char *resultCStr = UnityPurchasesGetAdditionalParamsCallback([jsonString UTF8String], "");
|
||||
if (!resultCStr) {
|
||||
NSLog(@"[AppsFlyer] Unity callback returned null");
|
||||
return @{};
|
||||
}
|
||||
|
||||
NSString *resultJson = [NSString stringWithUTF8String:resultCStr];
|
||||
NSData *resultData = [resultJson dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *parsedResult = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&error];
|
||||
|
||||
if (error || ![parsedResult isKindOfClass:[NSDictionary class]]) {
|
||||
NSLog(@"[AppsFlyer] Failed to parse Unity response: %@", error);
|
||||
return @{};
|
||||
}
|
||||
|
||||
return parsedResult;
|
||||
}
|
||||
|
||||
#pragma mark - AppsFlyerPurchaseRevenueDataSourceStoreKit2
|
||||
- (NSDictionary *)purchaseRevenueAdditionalParametersStoreKit2ForProducts:(NSSet<AFSDKProductSK2 *> *)products transactions:(NSSet<AFSDKTransactionSK2 *> *)transactions {
|
||||
if (@available(iOS 15.0, *)) {
|
||||
NSArray *productInfoArray = [AFUnityStoreKit2Bridge extractSK2ProductInfo:[products allObjects]];
|
||||
NSArray *transactionInfoArray = [AFUnityStoreKit2Bridge extractSK2TransactionInfo:[transactions allObjects]];
|
||||
|
||||
NSDictionary *input = @{
|
||||
@"products": productInfoArray,
|
||||
@"transactions": transactionInfoArray
|
||||
};
|
||||
|
||||
if (UnityPurchasesGetAdditionalParamsCallbackSK2) {
|
||||
NSError *error = nil;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:input options:0 error:&error];
|
||||
if (error || !jsonData) {
|
||||
NSLog(@"[AppsFlyer] Failed to serialize Unity purchase data: %@", error);
|
||||
return @{};
|
||||
}
|
||||
|
||||
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
|
||||
const char *resultCStr = UnityPurchasesGetAdditionalParamsCallbackSK2([jsonString UTF8String], "");
|
||||
if (!resultCStr) {
|
||||
NSLog(@"[AppsFlyer] Unity callback returned null");
|
||||
return @{};
|
||||
}
|
||||
|
||||
NSString *resultJson = [NSString stringWithUTF8String:resultCStr];
|
||||
|
||||
NSData *resultData = [resultJson dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *parsedResult = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&error];
|
||||
|
||||
if (error || ![parsedResult isKindOfClass:[NSDictionary class]]) {
|
||||
NSLog(@"[AppsFlyer] Failed to parse Unity response: %@", error);
|
||||
return @{};
|
||||
}
|
||||
|
||||
return parsedResult;
|
||||
} else {
|
||||
NSLog(@"[AppsFlyer] SK2 - Unity callback is NOT registered");
|
||||
}
|
||||
} else {
|
||||
NSLog(@"[AppsFlyer] SK2 - iOS version not supported");
|
||||
}
|
||||
return @{};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import Foundation
|
||||
@@ -1,37 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a631431c30cca4ac2bb4b40fc67e4005
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
184
sdk-intergration/Assets/AppsFlyer/ProductPurchase.cs
Normal file
184
sdk-intergration/Assets/AppsFlyer/ProductPurchase.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
#nullable enable
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class InAppPurchaseValidationResult : EventArgs
|
||||
{
|
||||
public bool success;
|
||||
public ProductPurchase? productPurchase;
|
||||
public ValidationFailureData? failureData;
|
||||
public string? token;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ProductPurchase
|
||||
{
|
||||
public string? kind;
|
||||
public string? purchaseTimeMillis;
|
||||
public int purchaseState;
|
||||
public int consumptionState;
|
||||
public string? developerPayload;
|
||||
public string? orderId;
|
||||
public int purchaseType;
|
||||
public int acknowledgementState;
|
||||
public string? purchaseToken;
|
||||
public string? productId;
|
||||
public int quantity;
|
||||
public string? obfuscatedExternalAccountId;
|
||||
public string? obfuscatedExternalProfil;
|
||||
public string? regionCode;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ValidationFailureData
|
||||
{
|
||||
public int status;
|
||||
public string? description;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubscriptionValidationResult
|
||||
{
|
||||
public bool success;
|
||||
public SubscriptionPurchase? subscriptionPurchase;
|
||||
public ValidationFailureData? failureData;
|
||||
public string? token;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubscriptionPurchase
|
||||
{
|
||||
public string? acknowledgementState;
|
||||
public CanceledStateContext? canceledStateContext;
|
||||
public ExternalAccountIdentifiers? externalAccountIdentifiers;
|
||||
public string? kind;
|
||||
public string? latestOrderId;
|
||||
public List<SubscriptionPurchaseLineItem>? lineItems;
|
||||
public string? linkedPurchaseToken;
|
||||
public PausedStateContext? pausedStateContext;
|
||||
public string? regionCode;
|
||||
public string? startTime;
|
||||
public SubscribeWithGoogleInfo? subscribeWithGoogleInfo;
|
||||
public string? subscriptionState;
|
||||
public TestPurchase? testPurchase;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CanceledStateContext
|
||||
{
|
||||
public DeveloperInitiatedCancellation? developerInitiatedCancellation;
|
||||
public ReplacementCancellation? replacementCancellation;
|
||||
public SystemInitiatedCancellation? systemInitiatedCancellation;
|
||||
public UserInitiatedCancellation? userInitiatedCancellation;
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ExternalAccountIdentifiers
|
||||
{
|
||||
public string? externalAccountId;
|
||||
public string? obfuscatedExternalAccountId;
|
||||
public string? obfuscatedExternalProfileId;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubscriptionPurchaseLineItem
|
||||
{
|
||||
public AutoRenewingPlan? autoRenewingPlan;
|
||||
public DeferredItemReplacement? deferredItemReplacement;
|
||||
public string? expiryTime;
|
||||
public OfferDetails? offerDetails;
|
||||
public PrepaidPlan? prepaidPlan;
|
||||
public string? productId;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class PausedStateContext
|
||||
{
|
||||
public string? autoResumeTime;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubscribeWithGoogleInfo
|
||||
{
|
||||
public string? emailAddress;
|
||||
public string? familyName;
|
||||
public string? givenName;
|
||||
public string? profileId;
|
||||
public string? profileName;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class TestPurchase{}
|
||||
|
||||
[System.Serializable]
|
||||
public class DeveloperInitiatedCancellation{}
|
||||
|
||||
[System.Serializable]
|
||||
public class ReplacementCancellation{}
|
||||
|
||||
[System.Serializable]
|
||||
public class SystemInitiatedCancellation{}
|
||||
|
||||
[System.Serializable]
|
||||
public class UserInitiatedCancellation
|
||||
{
|
||||
public CancelSurveyResult? cancelSurveyResult;
|
||||
public string? cancelTime;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class AutoRenewingPlan
|
||||
{
|
||||
public string? autoRenewEnabled;
|
||||
public SubscriptionItemPriceChangeDetails? priceChangeDetails;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class DeferredItemReplacement
|
||||
{
|
||||
public string? productId;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class OfferDetails
|
||||
{
|
||||
public List<string>? offerTags;
|
||||
public string? basePlanId;
|
||||
public string? offerId;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class PrepaidPlan
|
||||
{
|
||||
public string? allowExtendAfterTime;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CancelSurveyResult
|
||||
{
|
||||
public string? reason;
|
||||
public string? reasonUserInput;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubscriptionItemPriceChangeDetails
|
||||
{
|
||||
public string? expectedNewPriceChargeTime;
|
||||
public Money? newPrice;
|
||||
public string? priceChangeMode;
|
||||
public string? priceChangeState;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Money
|
||||
{
|
||||
public string? currencyCode;
|
||||
public long nanos;
|
||||
public long units;
|
||||
}
|
||||
|
||||
11
sdk-intergration/Assets/AppsFlyer/ProductPurchase.cs.meta
Normal file
11
sdk-intergration/Assets/AppsFlyer/ProductPurchase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a1435104a69d4c8ebcc6f237cc29a54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f19f272c71674582bed1d93925da003
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b5b4579db85b4cfd8395bfb19aa309e
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 642cf65ed2573419bab7e7d44fc73181
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a5ccbd864ba94a9a9ba47895ff14922
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee45ae2608f3c44d08fc6e21a94d133f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "Tests",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
"AppsFlyer"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll",
|
||||
"NSubstitute.dll",
|
||||
"Castle.Core.dll",
|
||||
"System.Threading.Tasks.Extensions.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [
|
||||
"UNITY_INCLUDE_TESTS"
|
||||
],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f155a0e4c9ab48eeb4b54b2dc0aeba7
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,810 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using NSubstitute;
|
||||
|
||||
namespace AppsFlyerSDK.Tests
|
||||
{
|
||||
public class NewTestScript
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void test_startSDK_called()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.startSDK();
|
||||
AppsFlyerMOCKInterface.Received().startSDK(Arg.Any<bool>(), Arg.Any<string>());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_sendEvent_withValues()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
var eventParams = new Dictionary<string, string>();
|
||||
eventParams.Add("key", "value");
|
||||
AppsFlyer.sendEvent("testevent", eventParams);
|
||||
AppsFlyerMOCKInterface.Received().sendEvent("testevent", eventParams, false, null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_sendEvent_withNullParams()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.sendEvent("testevent", null);
|
||||
AppsFlyerMOCKInterface.Received().sendEvent("testevent", null,false, null);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void test_isSDKStopped_true()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.stopSDK(true);
|
||||
|
||||
AppsFlyerMOCKInterface.Received().stopSDK(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_isSDKStopped_false()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
AppsFlyer.stopSDK(false);
|
||||
|
||||
AppsFlyerMOCKInterface.Received().stopSDK(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_isSDKStopped_called()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
var isSDKStopped = AppsFlyer.isSDKStopped();
|
||||
|
||||
AppsFlyerMOCKInterface.Received().isSDKStopped();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_isSDKStopped_receveivedFalse()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
var isSDKStopped = AppsFlyer.isSDKStopped();
|
||||
|
||||
Assert.AreEqual(AppsFlyerMOCKInterface.Received().isSDKStopped(), false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void test_getSdkVersion_called()
|
||||
{
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.getSdkVersion();
|
||||
AppsFlyerMOCKInterface.Received().getSdkVersion();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void test_setCustomerUserId_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCustomerUserId("test");
|
||||
AppsFlyerMOCKInterface.Received().setCustomerUserId("test");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setAppInviteOneLinkID_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setAppInviteOneLinkID("2f36");
|
||||
AppsFlyerMOCKInterface.Received().setAppInviteOneLinkID("2f36");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setAdditionalData_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
var customData = new Dictionary<string, string>();
|
||||
customData.Add("test", "test");
|
||||
AppsFlyer.setAdditionalData(customData);
|
||||
AppsFlyerMOCKInterface.Received().setAdditionalData(customData);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setResolveDeepLinkURLs_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setResolveDeepLinkURLs("url1", "url2");
|
||||
AppsFlyerMOCKInterface.Received().setResolveDeepLinkURLs("url1", "url2");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setOneLinkCustomDomain_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setOneLinkCustomDomain("url1", "url2");
|
||||
AppsFlyerMOCKInterface.Received().setOneLinkCustomDomain("url1", "url2");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setCurrencyCode_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCurrencyCode("usd");
|
||||
AppsFlyerMOCKInterface.Received().setCurrencyCode("usd");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_recordLocation_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.recordLocation(0.3, 5.2);
|
||||
AppsFlyerMOCKInterface.Received().recordLocation(0.3, 5.2);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_anonymizeUser_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.anonymizeUser(true);
|
||||
AppsFlyerMOCKInterface.Received().anonymizeUser(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_anonymizeUser_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.anonymizeUser(false);
|
||||
AppsFlyerMOCKInterface.Received().anonymizeUser(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_getAppsFlyerId_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.getAppsFlyerId();
|
||||
AppsFlyerMOCKInterface.Received().getAppsFlyerId();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setMinTimeBetweenSessions_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setMinTimeBetweenSessions(3);
|
||||
AppsFlyerMOCKInterface.Received().setMinTimeBetweenSessions(3);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setHost_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setHost("prefix", "name");
|
||||
AppsFlyerMOCKInterface.Received().setHost("prefix", "name");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_setPhoneNumber_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setPhoneNumber("002");
|
||||
AppsFlyerMOCKInterface.Received().setPhoneNumber("002");
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
[System.Obsolete]
|
||||
public void Test_setSharingFilterForAllPartners_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setSharingFilterForAllPartners();
|
||||
AppsFlyerMOCKInterface.Received().setSharingFilterForAllPartners();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
[System.Obsolete]
|
||||
public void Test_setSharingFilter_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
|
||||
AppsFlyer.setSharingFilter("filter1", "filter2");
|
||||
AppsFlyerMOCKInterface.Received().setSharingFilter("filter1", "filter2");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_getConversionData_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
AppsFlyer.getConversionData("ObjectName");
|
||||
AppsFlyerMOCKInterface.Received().getConversionData("ObjectName");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_attributeAndOpenStore_called_withParams()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters.Add("af_sub1", "val");
|
||||
parameters.Add("custom_param", "val2");
|
||||
AppsFlyer.attributeAndOpenStore("appid", "campaign", parameters, new MonoBehaviour());
|
||||
AppsFlyerMOCKInterface.Received().attributeAndOpenStore("appid", "campaign", parameters, Arg.Any<MonoBehaviour>());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_attributeAndOpenStore_called_nullParams()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
AppsFlyer.attributeAndOpenStore("appid", "campaign", null, new MonoBehaviour());
|
||||
AppsFlyerMOCKInterface.Received().attributeAndOpenStore("appid", "campaign", null, Arg.Any<MonoBehaviour>());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_recordCrossPromoteImpression_calledWithParameters()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters.Add("af_sub1", "val");
|
||||
parameters.Add("custom_param", "val2");
|
||||
AppsFlyer.recordCrossPromoteImpression("appid", "campaign", parameters);
|
||||
AppsFlyerMOCKInterface.Received().recordCrossPromoteImpression("appid", "campaign", parameters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void Test_recordCrossPromoteImpression_calledWithoutParameters()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.recordCrossPromoteImpression("appid", "campaign", null);
|
||||
AppsFlyerMOCKInterface.Received().recordCrossPromoteImpression("appid", "campaign", null);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_generateUserInviteLink_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
|
||||
AppsFlyer.generateUserInviteLink(new Dictionary<string, string>(), new MonoBehaviour());
|
||||
AppsFlyerMOCKInterface.Received().generateUserInviteLink(Arg.Any<Dictionary<string, string>>(), Arg.Any<MonoBehaviour>());
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void Test_addPushNotificationDeepLinkPath_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerNativeBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.addPushNotificationDeepLinkPath("path1", "path2");
|
||||
AppsFlyerMOCKInterface.Received().addPushNotificationDeepLinkPath("path1", "path2");
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID
|
||||
[Test]
|
||||
public void updateServerUninstallToken_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.updateServerUninstallToken("tokenTest");
|
||||
AppsFlyerMOCKInterface.Received().updateServerUninstallToken("tokenTest");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setImeiData_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setImeiData("imei");
|
||||
AppsFlyerMOCKInterface.Received().setImeiData("imei");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setAndroidIdData_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setAndroidIdData("androidId");
|
||||
AppsFlyerMOCKInterface.Received().setAndroidIdData("androidId");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void waitForCustomerUserId_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.waitForCustomerUserId(true);
|
||||
AppsFlyerMOCKInterface.Received().waitForCustomerUserId(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setCustomerIdAndStartSDK_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCustomerIdAndStartSDK("01234");
|
||||
AppsFlyerMOCKInterface.Received().setCustomerIdAndStartSDK("01234");
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void getOutOfStore_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.getOutOfStore();
|
||||
AppsFlyerMOCKInterface.Received().getOutOfStore();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setOutOfStore_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setOutOfStore("test");
|
||||
AppsFlyerMOCKInterface.Received().setOutOfStore("test");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setCollectAndroidID_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCollectAndroidID(true);
|
||||
AppsFlyerMOCKInterface.Received().setCollectAndroidID(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setCollectIMEI_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCollectIMEI(true);
|
||||
AppsFlyerMOCKInterface.Received().setCollectIMEI(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setIsUpdate_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setIsUpdate(true);
|
||||
AppsFlyerMOCKInterface.Received().setIsUpdate(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setPreinstallAttribution_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setPreinstallAttribution("mediaSourceTestt", "campaign", "sideId");
|
||||
AppsFlyerMOCKInterface.Received().setPreinstallAttribution("mediaSourceTestt", "campaign", "sideId");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void isPreInstalledApp_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.isPreInstalledApp();
|
||||
AppsFlyerMOCKInterface.Received().isPreInstalledApp();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void getAttributionId_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.getAttributionId();
|
||||
AppsFlyerMOCKInterface.Received().getAttributionId();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void handlePushNotifications_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.handlePushNotifications();
|
||||
AppsFlyerMOCKInterface.Received().handlePushNotifications();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void validateAndSendInAppPurchase_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.validateAndSendInAppPurchase("ewjkekwjekw","hewjehwj", "purchaseData", "3.0", "USD", null, null);
|
||||
AppsFlyerMOCKInterface.Received().validateAndSendInAppPurchase("ewjkekwjekw", "hewjehwj", "purchaseData", "3.0", "USD", null, null);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setCollectOaid_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCollectOaid(true);
|
||||
AppsFlyerMOCKInterface.Received().setCollectOaid(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setDisableAdvertisingIdentifiers_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableAdvertisingIdentifiers(true);
|
||||
AppsFlyerMOCKInterface.Received().setDisableAdvertisingIdentifiers(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setDisableNetworkData_called() {
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerAndroidBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableNetworkData(true);
|
||||
AppsFlyerMOCKInterface.Received().setDisableNetworkData(true);
|
||||
}
|
||||
#elif UNITY_IOS
|
||||
|
||||
[Test]
|
||||
public void setDisableCollectAppleAdSupport_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableCollectAppleAdSupport(true);
|
||||
AppsFlyerMOCKInterface.Received().setDisableCollectAppleAdSupport(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setDisableCollectAppleAdSupport_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableCollectAppleAdSupport(false);
|
||||
AppsFlyerMOCKInterface.Received().setDisableCollectAppleAdSupport(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
[System.Obsolete]
|
||||
public void setShouldCollectDeviceName_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setShouldCollectDeviceName(true);
|
||||
AppsFlyerMOCKInterface.Received().setShouldCollectDeviceName(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
[System.Obsolete]
|
||||
public void setShouldCollectDeviceName_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setShouldCollectDeviceName(false);
|
||||
AppsFlyerMOCKInterface.Received().setShouldCollectDeviceName(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setDisableCollectIAd_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableCollectIAd(true);
|
||||
AppsFlyerMOCKInterface.Received().setDisableCollectIAd(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setDisableCollectIAd_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setDisableCollectIAd(false);
|
||||
AppsFlyerMOCKInterface.Received().setDisableCollectIAd(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setUseReceiptValidationSandbox_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setUseReceiptValidationSandbox(true);
|
||||
AppsFlyerMOCKInterface.Received().setUseReceiptValidationSandbox(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setUseReceiptValidationSandbox_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setUseReceiptValidationSandbox(false);
|
||||
AppsFlyerMOCKInterface.Received().setUseReceiptValidationSandbox(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ssetUseUninstallSandbox_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setUseUninstallSandbox(true);
|
||||
AppsFlyerMOCKInterface.Received().setUseUninstallSandbox(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setUseUninstallSandbox_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setUseUninstallSandbox(false);
|
||||
AppsFlyerMOCKInterface.Received().setUseUninstallSandbox(false);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void validateAndSendInAppPurchase_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.validateAndSendInAppPurchase("3d2", "5.0","USD", "45", null, null);
|
||||
AppsFlyerMOCKInterface.Received().validateAndSendInAppPurchase("3d2", "5.0", "USD", "45", null, null);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void registerUninstall_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
byte[] token = System.Text.Encoding.UTF8.GetBytes("740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad");
|
||||
AppsFlyer.registerUninstall(token);
|
||||
AppsFlyerMOCKInterface.Received().registerUninstall(token);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void handleOpenUrl_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.handleOpenUrl("www.test.com", "appTest", "test");
|
||||
AppsFlyerMOCKInterface.Received().handleOpenUrl("www.test.com", "appTest", "test");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void waitForATTUserAuthorizationWithTimeoutInterval_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.waitForATTUserAuthorizationWithTimeoutInterval(30);
|
||||
AppsFlyerMOCKInterface.Received().waitForATTUserAuthorizationWithTimeoutInterval(30);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void setCurrentDeviceLanguage_called()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.setCurrentDeviceLanguage("en");
|
||||
AppsFlyerMOCKInterface.Received().setCurrentDeviceLanguage("en");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void disableSKAdNetwork_called_true()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.disableSKAdNetwork(true);
|
||||
AppsFlyerMOCKInterface.Received().disableSKAdNetwork(true);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void disableSKAdNetwork_called_false()
|
||||
{
|
||||
|
||||
var AppsFlyerMOCKInterface = Substitute.For<IAppsFlyerIOSBridge>();
|
||||
|
||||
AppsFlyer.instance = AppsFlyerMOCKInterface;
|
||||
AppsFlyer.disableSKAdNetwork(false);
|
||||
AppsFlyerMOCKInterface.Received().disableSKAdNetwork(false);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b1a24aa01166451d804d7c03c14a3db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "appsflyer-unity-plugin",
|
||||
"displayName": "AppsFlyer",
|
||||
"description": "AppsFlyer Unity plugin",
|
||||
"version": "6.14.0",
|
||||
"version": "6.17.5",
|
||||
"unity": "2019.4",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<application android:extractNativeLibs="true" android:name="com.unity3d.player.TYApp"
|
||||
tools:replace="android:usesCleartextTraffic"
|
||||
android:usesCleartextTraffic="true">
|
||||
<application android:extractNativeLibs="true" android:name="com.unity3d.player.TYApp" android:usesCleartextTraffic="true">
|
||||
<activity android:name="com.unity3d.player.TYUnityActivity"
|
||||
android:theme="@style/UnityThemeSelector">
|
||||
<intent-filter>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
|
||||
org.gradle.parallel=true
|
||||
unityStreamingAssets=**STREAMING_ASSETS**
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
# Android Resolver Properties Start
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
# Android Resolver Properties End
|
||||
|
||||
android.suppressUnsupportedCompileSdk=35
|
||||
|
||||
**ADDITIONAL_PROPERTIES**
|
||||
|
||||
@@ -17,7 +17,6 @@ android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
@@ -29,14 +28,6 @@ android {
|
||||
}
|
||||
versionCode **VERSIONCODE**
|
||||
versionName '**VERSIONNAME**'
|
||||
|
||||
// ↓↓↓ 这里放你的 VK ID 占位符 ↓↓↓
|
||||
manifestPlaceholders = [
|
||||
VKIDRedirectHost : "vk.ru",
|
||||
VKIDRedirectScheme: "vk54432404",
|
||||
VKIDClientID : "54432404",
|
||||
VKIDClientSecret : "WD6BO0CwPXsKMaaFX8Qq"
|
||||
]
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
|
||||
@@ -59,15 +59,8 @@ dependencies {
|
||||
implementation "androidx.credentials:credentials-play-services-auth:1.3.0"
|
||||
implementation "com.google.android.libraries.identity.googleid:googleid:1.1.1"
|
||||
|
||||
|
||||
implementation(platform("ru.rustore.sdk:bom:2025.11.01"))
|
||||
implementation("ru.rustore.sdk:pay")
|
||||
implementation "ru.rustore.sdk:review:10.0.0"
|
||||
implementation "com.vk.id:vkid:2.5.1"
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.2"
|
||||
|
||||
// Android Resolver Dependencies Start
|
||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
|
||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:7
|
||||
implementation 'com.applovin.mediation:facebook-adapter:[6.18.0.1]' // Assets/MaxSdk/Mediation/Facebook/Editor/Dependencies.xml:8
|
||||
implementation 'com.applovin.mediation:fyber-adapter:8.4.2.0' // Assets/MaxSdk/Mediation/Fyber/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:google-adapter:[23.6.0.1]' // Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml:5
|
||||
@@ -75,10 +68,9 @@ dependencies {
|
||||
implementation 'com.applovin.mediation:unityads-adapter:4.12.3.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:vungle-adapter:7.4.2.2' // Assets/MaxSdk/Mediation/Vungle/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin:applovin-sdk:13.5.1' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4
|
||||
implementation 'com.appsflyer:adrevenue:6.9.1' // Assets/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:4
|
||||
implementation 'com.appsflyer:af-android-sdk:6.14.0' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
||||
implementation 'com.appsflyer:unity-adrevenue-generic-wrapper:6.9.1' // Assets/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:5
|
||||
implementation 'com.appsflyer:unity-wrapper:6.14.3' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||
implementation 'com.appsflyer:af-android-sdk:6.17.3' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:5
|
||||
implementation 'com.appsflyer:purchase-connector:2.2.0' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||
implementation 'com.appsflyer:unity-wrapper:6.17.7' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
||||
implementation 'com.google.android.ump:user-messaging-platform:2.1.0' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:5
|
||||
// Android Resolver Dependencies End
|
||||
**DEPS**}
|
||||
@@ -103,7 +95,6 @@ android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
@@ -112,7 +103,6 @@ android {
|
||||
ndk {
|
||||
abiFilters **ABIFILTERS**
|
||||
}
|
||||
|
||||
versionCode **VERSIONCODE**
|
||||
versionName '**VERSIONNAME**'
|
||||
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
|
||||
|
||||
@@ -16,17 +16,6 @@ dependencyResolutionManagement {
|
||||
**ARTIFACTORYREPOSITORY**
|
||||
google()
|
||||
mavenCentral()
|
||||
|
||||
maven{
|
||||
url "https://artifactory-external.vkpartner.ru/artifactory/vkid-sdk-android/"
|
||||
}
|
||||
maven{
|
||||
url "https://artifactory-external.vkpartner.ru/artifactory/maven/"
|
||||
}
|
||||
maven{
|
||||
url "https://artifactory-external.vkpartner.ru/artifactory/vk-id-captcha/android/"
|
||||
}
|
||||
|
||||
// Android Resolver Repos Start
|
||||
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
|
||||
maven {
|
||||
|
||||
@@ -38,6 +38,7 @@ RenderSettings:
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.12733836, g: 0.13418846, b: 0.12118524, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
@@ -122,85 +123,6 @@ NavMeshSettings:
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &9113281
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9113282}
|
||||
- component: {fileID: 9113284}
|
||||
- component: {fileID: 9113283}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9113282
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9113281}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 678940590}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &9113283
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9113281}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 33
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Review
|
||||
--- !u!222 &9113284
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9113281}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &29523098
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -443,85 +365,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120435829}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &159485066
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 159485067}
|
||||
- component: {fileID: 159485069}
|
||||
- component: {fileID: 159485068}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &159485067
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 159485066}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1113066541}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &159485068
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 159485066}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 33
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: L_VK
|
||||
--- !u!222 &159485069
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 159485066}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &174456813
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -748,127 +591,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 231808344}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &263924338
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 263924339}
|
||||
- component: {fileID: 263924341}
|
||||
- component: {fileID: 263924340}
|
||||
- component: {fileID: 263924342}
|
||||
m_Layer: 5
|
||||
m_Name: VkLogin
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &263924339
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 263924338}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 959891290}
|
||||
m_Father: {fileID: 1044920373}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &263924340
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 263924338}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &263924341
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 263924338}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &263924342
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 263924338}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 263924340}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &276006784
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1079,12 +801,12 @@ MonoBehaviour:
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
m_JitterScale: 1
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
quality: 3
|
||||
frameInfluence: 0.1
|
||||
jitterScale: 1
|
||||
mipBias: 0
|
||||
varianceClampScale: 0.9
|
||||
contrastAdaptiveSharpening: 0
|
||||
--- !u!1 &340278280
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1243,127 +965,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 354913240}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &365226264
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 365226265}
|
||||
- component: {fileID: 365226268}
|
||||
- component: {fileID: 365226267}
|
||||
- component: {fileID: 365226266}
|
||||
m_Layer: 5
|
||||
m_Name: CVk
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &365226265
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 365226264}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 425077563}
|
||||
m_Father: {fileID: 1044920373}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &365226266
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 365226264}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 365226267}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &365226267
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 365226264}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &365226268
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 365226264}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &407966797
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1443,85 +1044,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 407966797}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &425077562
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 425077563}
|
||||
- component: {fileID: 425077565}
|
||||
- component: {fileID: 425077564}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &425077563
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 425077562}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 365226265}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &425077564
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 425077562}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 33
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: C_VK
|
||||
--- !u!222 &425077565
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 425077562}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &571824850
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1643,127 +1165,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 571824850}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &678940589
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 678940590}
|
||||
- component: {fileID: 678940593}
|
||||
- component: {fileID: 678940592}
|
||||
- component: {fileID: 678940591}
|
||||
m_Layer: 5
|
||||
m_Name: Review
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &678940590
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 678940589}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 9113282}
|
||||
m_Father: {fileID: 1044920373}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &678940591
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 678940589}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 678940592}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &678940592
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 678940589}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &678940593
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 678940589}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &686445508
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2643,85 +2044,6 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &959891289
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 959891290}
|
||||
- component: {fileID: 959891292}
|
||||
- component: {fileID: 959891291}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &959891290
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 959891289}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 263924339}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &959891291
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 959891289}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 33
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: VK
|
||||
--- !u!222 &959891292
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 959891289}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1033367769
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2954,14 +2276,11 @@ RectTransform:
|
||||
- {fileID: 1956900235}
|
||||
- {fileID: 1910171036}
|
||||
- {fileID: 1188788676}
|
||||
- {fileID: 263924339}
|
||||
- {fileID: 1627053315}
|
||||
- {fileID: 1668967320}
|
||||
- {fileID: 834002869}
|
||||
- {fileID: 1094138236}
|
||||
- {fileID: 698899140}
|
||||
- {fileID: 1113066541}
|
||||
- {fileID: 365226265}
|
||||
- {fileID: 948068709}
|
||||
- {fileID: 1033467961}
|
||||
- {fileID: 571824851}
|
||||
@@ -2974,7 +2293,6 @@ RectTransform:
|
||||
- {fileID: 1686948820}
|
||||
- {fileID: 827533342}
|
||||
- {fileID: 1240291498}
|
||||
- {fileID: 678940590}
|
||||
m_Father: {fileID: 1451597222}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -3448,127 +2766,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1110300852}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1113066540
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1113066541}
|
||||
- component: {fileID: 1113066544}
|
||||
- component: {fileID: 1113066543}
|
||||
- component: {fileID: 1113066542}
|
||||
m_Layer: 5
|
||||
m_Name: LVK
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1113066541
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1113066540}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 159485067}
|
||||
m_Father: {fileID: 1044920373}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &1113066542
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1113066540}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1113066543}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &1113066543
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1113066540}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1113066544
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1113066540}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1156426215
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4946,12 +4143,9 @@ MonoBehaviour:
|
||||
_InitBtn: {fileID: 1956900236}
|
||||
_loginGuestBtn: {fileID: 1910171037}
|
||||
_loginGoogleBtn: {fileID: 1188788679}
|
||||
_loginVkBtn: {fileID: 263924342}
|
||||
_loginFbBtn: {fileID: 1627053318}
|
||||
_loginAppleBtn: {fileID: 1668967321}
|
||||
_loginTokenBtn: {fileID: 834002870}
|
||||
_linkVkBtn: {fileID: 1113066542}
|
||||
_checkVkBtn: {fileID: 365226266}
|
||||
_linkGoogleBtn: {fileID: 1094138239}
|
||||
_checkGoogleBtn: {fileID: 698899143}
|
||||
_linkFacbookBtn: {fileID: 948068712}
|
||||
@@ -4966,7 +4160,6 @@ MonoBehaviour:
|
||||
_signoutBtn: {fileID: 1686948823}
|
||||
_fbShareLinkBtn: {fileID: 827533345}
|
||||
_mfbShareLinkBtn: {fileID: 1240291501}
|
||||
_reviewBtn: {fileID: 678940591}
|
||||
_messageTxt: {fileID: 2070325010}
|
||||
--- !u!4 &1788702880
|
||||
Transform:
|
||||
|
||||
@@ -75,7 +75,7 @@ public class AFDeepLinkHelper : MonoBehaviour, IAppsFlyerConversionData, IAppsFl
|
||||
#endif
|
||||
|
||||
AppsFlyer.startSDK();
|
||||
AppsFlyerSDK.AppsFlyerAdRevenue.start();
|
||||
// AppsFlyerSDK.AppsFlyerAdRevenue.start();
|
||||
}
|
||||
|
||||
public async Task<string> GenInviteLink(string referrerUID, string referrerPID)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppsFlyerSDK;
|
||||
using asap.core;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -15,8 +16,6 @@ public class SDKTest : MonoBehaviour
|
||||
private Button _loginGuestBtn;
|
||||
[SerializeField]
|
||||
private Button _loginGoogleBtn;
|
||||
[SerializeField] // 海外VkId 登陆
|
||||
private Button _loginVkBtn;
|
||||
[SerializeField]
|
||||
private Button _loginFbBtn;
|
||||
[SerializeField]
|
||||
@@ -24,10 +23,6 @@ public class SDKTest : MonoBehaviour
|
||||
[SerializeField]
|
||||
private Button _loginTokenBtn;
|
||||
[SerializeField]
|
||||
private Button _linkVkBtn;
|
||||
[SerializeField]
|
||||
private Button _checkVkBtn;
|
||||
[SerializeField]
|
||||
private Button _linkGoogleBtn;
|
||||
[SerializeField]
|
||||
private Button _checkGoogleBtn;
|
||||
@@ -55,10 +50,6 @@ public class SDKTest : MonoBehaviour
|
||||
private Button _fbShareLinkBtn;
|
||||
[SerializeField]
|
||||
private Button _mfbShareLinkBtn;
|
||||
|
||||
[SerializeField]
|
||||
private Button _reviewBtn;
|
||||
|
||||
[SerializeField]
|
||||
private Text _messageTxt;
|
||||
|
||||
@@ -73,7 +64,7 @@ public class SDKTest : MonoBehaviour
|
||||
//===============================================================================
|
||||
//====================== Test Server ===========================
|
||||
// UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com");
|
||||
config.Set("AGG_SERVER", "https://128-hwsfsdk-sdk-test01.qijihdhk.com");
|
||||
// config.Set("AGG_SERVER", "https://128-hwsfsdk-sdk-test01.qijihdhk.com");
|
||||
//====================== Test Server ===========================
|
||||
//===============================================================================
|
||||
//
|
||||
@@ -81,8 +72,6 @@ public class SDKTest : MonoBehaviour
|
||||
_loginGuestBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGuest));
|
||||
_loginGoogleBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGoogle));
|
||||
_loginFbBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwFacebook));
|
||||
_loginVkBtn.onClick.AddListener(()=> OnLogin(EAccoutType.hwVkid));
|
||||
|
||||
#if UNITY_IOS
|
||||
_loginAppleBtn.onClick.AddListener(() => OnLogin(EAccoutType.Apple));
|
||||
#endif
|
||||
@@ -90,8 +79,6 @@ public class SDKTest : MonoBehaviour
|
||||
_logOutBtn.onClick.AddListener(OnLogout);
|
||||
_linkGoogleBtn.onClick.AddListener(OnLinkGoogle);
|
||||
_checkGoogleBtn.onClick.AddListener(OncheckGoogle);
|
||||
_linkVkBtn.onClick.AddListener(OnLinkVkId);
|
||||
_checkVkBtn.onClick.AddListener(OnCheckVKId);
|
||||
_linkFacbookBtn.onClick.AddListener(OnLinkFacebook);
|
||||
_linkAppleBtn.onClick.AddListener(OnLinkApple);
|
||||
_checkFacbookBtn.onClick.AddListener(OncheckFacebook);
|
||||
@@ -103,7 +90,6 @@ public class SDKTest : MonoBehaviour
|
||||
_signoutBtn.onClick.AddListener(OnSignoutBtn);
|
||||
_fbShareLinkBtn.onClick.AddListener(OnFBShareLinkBtn);
|
||||
_mfbShareLinkBtn.onClick.AddListener(OnMessengerShareLinkBtn);
|
||||
_reviewBtn.onClick.AddListener(OnReview);
|
||||
Debug.Log("SDKTest Started");
|
||||
}
|
||||
|
||||
@@ -119,15 +105,15 @@ public class SDKTest : MonoBehaviour
|
||||
AppsFlyer.initSDK("rSySeWtvKabfbPZE7Lmx7C", null);
|
||||
#endif
|
||||
AppsFlyer.startSDK();
|
||||
AppsFlyerAdRevenue.start();
|
||||
// AppsFlyerAdRevenue.start();
|
||||
|
||||
InitializeRewardedAds();
|
||||
|
||||
var customId = TDAnalytics.GetDistinctId();
|
||||
var customId_2 = TDAnalytics.GetDistinctId("0caf287574bd4a9bb08be8995705ef6f");
|
||||
Debug.Log($"customId = {customId}, customId_2 = {customId_2}");
|
||||
|
||||
// UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com");
|
||||
|
||||
UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com");
|
||||
}
|
||||
|
||||
int retryAttempt;
|
||||
@@ -192,21 +178,16 @@ public class SDKTest : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// var sku = new SKUDetail();
|
||||
// sku.productId = "com.arkgame.ft.1chooseone0199";
|
||||
// sku.ourProductId= "comarkgameftcharge0199";
|
||||
// sku.title = "$1.99 choose one" ;
|
||||
// // sku.price = "16900";
|
||||
// // sku.price = 169;
|
||||
// sku.price = "16900";
|
||||
|
||||
#if !UNITY_EDITOR && UNITY_IOS
|
||||
sku.productId = "comarkgameftpack0199";
|
||||
sku.title = "商店-体力直充1.99" ;
|
||||
sku.price = "1.99";
|
||||
#endif
|
||||
|
||||
var purchaseInfo = new JObject();
|
||||
// purchaseInfo["ver"] = 2;
|
||||
purchaseInfo["pfid"] = "TestPlayer";
|
||||
// purchaseInfo["sum"] = sku.ProdPrice;
|
||||
purchaseInfo["customData"] = "{\"test\":\"test\"}";
|
||||
// purchaseInfo[]
|
||||
|
||||
|
||||
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ProdPrice, purchaseInfo);
|
||||
_messageTxt.text = "\n" + $"Success : {payResult.isSuccess}";
|
||||
@@ -225,7 +206,6 @@ public class SDKTest : MonoBehaviour
|
||||
_messageTxt.text = "products count:::" + result.products.Count;
|
||||
_messageTxt.text += "\n" + result.products[0].ToString();
|
||||
sku = result.products[0];
|
||||
Debug.Log($"sku = {sku}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -348,12 +328,6 @@ eb68f93a08156e04
|
||||
Debug.Log($"[AD LOG]Rewarded ad revenue paid \n {adInfo.ToString()}");
|
||||
}
|
||||
|
||||
private async void OnLinkVkId()
|
||||
{
|
||||
_messageTxt.text = string.Empty;
|
||||
var isSuccess = await TYSdkFacade.Instance.LinkAccount(EAccoutType.hwVkid);
|
||||
_messageTxt.text = $"\n link VkId account : {isSuccess} {isSuccess.code}";
|
||||
}
|
||||
|
||||
private async void OnLinkGoogle()
|
||||
{
|
||||
@@ -376,12 +350,6 @@ eb68f93a08156e04
|
||||
_messageTxt.text = $"\n link facebook account : {isSuccess}";
|
||||
}
|
||||
|
||||
private async void OnCheckVKId()
|
||||
{
|
||||
_messageTxt.text = string.Empty;
|
||||
var isSuccess = await TYSdkFacade.Instance.LinkCheck(EAccoutType.hwVkid);
|
||||
_messageTxt.text = $"\n google account linked : {isSuccess}";
|
||||
}
|
||||
private async void OncheckGoogle()
|
||||
{
|
||||
_messageTxt.text = string.Empty;
|
||||
@@ -411,11 +379,6 @@ eb68f93a08156e04
|
||||
UnityBridgeFunc.MessengerShareLink("title", "content", "https://www.baidu.com");
|
||||
}
|
||||
|
||||
private void OnReview()
|
||||
{
|
||||
UnityBridgeFunc.Review();
|
||||
}
|
||||
|
||||
/*
|
||||
public void OnTaBtn()
|
||||
{
|
||||
|
||||
@@ -76,12 +76,6 @@ MonoBehaviour:
|
||||
type: 3}
|
||||
dataDrivenLensFlare: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92,
|
||||
type: 3}
|
||||
terrainDetailLitPS: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144,
|
||||
type: 3}
|
||||
terrainDetailGrassPS: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1,
|
||||
type: 3}
|
||||
terrainDetailGrassBillboardPS: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90,
|
||||
type: 3}
|
||||
m_AssetVersion: 2
|
||||
m_OpaqueLayerMask:
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e9e076a217436a47b4b81811b4505db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,111 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe: Hierarchy 右键菜单创建视频播放器
|
||||
//----------------------------------------------------------------*/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public static class LeviathanVideoMenu
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建 UI 视频播放器 (RawImage)
|
||||
/// </summary>
|
||||
[MenuItem("GameObject/Leviathan Video/Leviathan Video Player (UI)", false, 10)]
|
||||
private static void CreateUIVideoPlayer(MenuCommand menuCommand)
|
||||
{
|
||||
// 创建 GameObject
|
||||
GameObject go = new GameObject("LeviathanVideoPlayer");
|
||||
|
||||
// 添加 RectTransform(UI 组件需要)
|
||||
RectTransform rectTransform = go.AddComponent<RectTransform>();
|
||||
rectTransform.sizeDelta = new Vector2(400, 300);
|
||||
|
||||
// 添加 RawImage 组件(LeviathanVideoDecoder 需要)
|
||||
RawImage rawImage = go.AddComponent<RawImage>();
|
||||
rawImage.color = Color.white;
|
||||
|
||||
// 添加视频解码器组件
|
||||
go.AddComponent<LeviathanVideoDecoder>();
|
||||
|
||||
// 设置父物体
|
||||
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
|
||||
// 如果没有父物体,尝试放到 Canvas 下
|
||||
if (go.transform.parent == null)
|
||||
{
|
||||
Canvas canvas = Object.FindObjectOfType<Canvas>();
|
||||
if (canvas != null)
|
||||
{
|
||||
go.transform.SetParent(canvas.transform, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有 Canvas,创建一个
|
||||
GameObject canvasGO = new GameObject("Canvas");
|
||||
canvas = canvasGO.AddComponent<Canvas>();
|
||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||
canvasGO.AddComponent<CanvasScaler>();
|
||||
canvasGO.AddComponent<GraphicRaycaster>();
|
||||
go.transform.SetParent(canvas.transform, false);
|
||||
}
|
||||
}
|
||||
|
||||
// 注册撤销
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (UI)");
|
||||
|
||||
// 选中创建的对象
|
||||
Selection.activeObject = go;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建 3D 视频播放器 (Cube)
|
||||
/// </summary>
|
||||
[MenuItem("GameObject/Leviathan Video/Leviathan Video Player (3D Cube)", false, 11)]
|
||||
private static void Create3DVideoPlayerCube(MenuCommand menuCommand)
|
||||
{
|
||||
// 创建 Cube
|
||||
GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
go.name = "LeviathanVideoPlayer3D";
|
||||
|
||||
// 添加视频渲染器组件
|
||||
go.AddComponent<LeviathanVideo3DRenderer>();
|
||||
|
||||
// 设置父物体
|
||||
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
|
||||
// 注册撤销
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (3D Cube)");
|
||||
|
||||
// 选中创建的对象
|
||||
Selection.activeObject = go;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建 3D 视频播放器 (Quad/Plane)
|
||||
/// </summary>
|
||||
[MenuItem("GameObject/Leviathan Video/Leviathan Video Player (3D Quad)", false, 12)]
|
||||
private static void Create3DVideoPlayerQuad(MenuCommand menuCommand)
|
||||
{
|
||||
// 创建 Quad
|
||||
GameObject go = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
||||
go.name = "LeviathanVideoPlayer3D";
|
||||
|
||||
// 添加视频渲染器组件
|
||||
go.AddComponent<LeviathanVideo3DRenderer>();
|
||||
|
||||
// 设置父物体
|
||||
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
|
||||
// 注册撤销
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (3D Quad)");
|
||||
|
||||
// 选中创建的对象
|
||||
Selection.activeObject = go;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7270087496e8e04a9f7984720cd2362
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,125 @@
|
||||
#if UNITY_WEBGL
|
||||
using UnityEditor;
|
||||
using UnityEditor.PackageManager;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
|
||||
namespace LeviathanVideo.Editor
|
||||
{
|
||||
public static class WeChatMiniGameMenu
|
||||
{
|
||||
private const string SourcePath = "Assets/WX-WASM-SDK-V2-v0.1.32~";
|
||||
private const string TargetPath = "Assets/WX-WASM-SDK-V2";
|
||||
private const string LeviathanWasmPath = "Assets/WX-WASM-SDK-V2/Editor/template/minigame/leviathan.wasm.br";
|
||||
private const string WeChatSDKGitUrl = "https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git";
|
||||
|
||||
private static AddRequest _addRequest;
|
||||
|
||||
// 验证函数:只在 WX-WASM-SDK-V2 文件夹不存在时启用
|
||||
[MenuItem("微信小游戏/[LeviathanVideo] 安装微信SDK", true)]
|
||||
public static bool ValidateInstallWeChatSDK()
|
||||
{
|
||||
return !Directory.Exists(TargetPath);
|
||||
}
|
||||
|
||||
[MenuItem("微信小游戏/[LeviathanVideo] 安装微信SDK", false)]
|
||||
public static void InstallWeChatSDK()
|
||||
{
|
||||
Debug.Log($"[LeviathanVideo] 开始安装微信SDK: {WeChatSDKGitUrl}");
|
||||
_addRequest = Client.Add(WeChatSDKGitUrl);
|
||||
EditorApplication.update += OnInstallProgress;
|
||||
}
|
||||
|
||||
private static void OnInstallProgress()
|
||||
{
|
||||
if (_addRequest == null || !_addRequest.IsCompleted)
|
||||
return;
|
||||
|
||||
EditorApplication.update -= OnInstallProgress;
|
||||
|
||||
if (_addRequest.Status == StatusCode.Success)
|
||||
{
|
||||
Debug.Log($"[LeviathanVideo] 微信SDK安装成功: {_addRequest.Result.packageId}");
|
||||
EditorUtility.DisplayDialog("安装成功",
|
||||
$"微信小游戏SDK安装成功!\n\n包ID: {_addRequest.Result.packageId}\n\n请执行下一步操作:\n微信小游戏 -> [LeviathanVideo] ****首次安装微信SDK后需要执行此操作****",
|
||||
"确定");
|
||||
}
|
||||
else if (_addRequest.Status >= StatusCode.Failure)
|
||||
{
|
||||
Debug.LogError($"[LeviathanVideo] 微信SDK安装失败: {_addRequest.Error.message}");
|
||||
EditorUtility.DisplayDialog("安装失败", $"微信小游戏SDK安装失败!\n\n错误: {_addRequest.Error.message}", "确定");
|
||||
}
|
||||
|
||||
_addRequest = null;
|
||||
}
|
||||
|
||||
// 验证函数:只在 leviathan.wasm.br 文件不存在时启用
|
||||
[MenuItem("微信小游戏/[LeviathanVideo] ****首次安装微信SDK后需要执行此操作**** ", true)]
|
||||
public static bool ValidateCopyFiles()
|
||||
{
|
||||
// 需要 SDK 已安装 且 leviathan.wasm.br 文件不存在
|
||||
return Directory.Exists(TargetPath) && !File.Exists(LeviathanWasmPath);
|
||||
}
|
||||
|
||||
[MenuItem("微信小游戏/[LeviathanVideo] ****首次安装微信SDK后需要执行此操作**** ", false)]
|
||||
public static void CopyFiles()
|
||||
{
|
||||
string sourcePath = Path.GetFullPath(SourcePath);
|
||||
string targetPath = Path.GetFullPath(TargetPath);
|
||||
|
||||
if (!Directory.Exists(sourcePath))
|
||||
{
|
||||
EditorUtility.DisplayDialog("错误", $"源路径不存在: {sourcePath}", "确定");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(targetPath))
|
||||
{
|
||||
EditorUtility.DisplayDialog("错误", $"目标路径不存在: {targetPath}", "确定");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CopyDirectory(sourcePath, targetPath);
|
||||
AssetDatabase.Refresh();
|
||||
EditorUtility.DisplayDialog("完成", $"已将文件从\n{SourcePath}\n复制到\n{TargetPath}", "确定");
|
||||
Debug.Log($"[Leviathan] 文件复制完成: {SourcePath} -> {TargetPath}");
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
EditorUtility.DisplayDialog("错误", $"复制文件时出错: {e.Message}", "确定");
|
||||
Debug.LogError($"[Leviathan] 复制文件失败: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyDirectory(string sourceDir, string targetDir)
|
||||
{
|
||||
// 复制所有文件
|
||||
foreach (string file in Directory.GetFiles(sourceDir))
|
||||
{
|
||||
string fileName = Path.GetFileName(file);
|
||||
string destFile = Path.Combine(targetDir, fileName);
|
||||
File.Copy(file, destFile, true);
|
||||
Debug.Log($"[Leviathan] 复制文件: {fileName}");
|
||||
}
|
||||
|
||||
// 递归复制所有子目录
|
||||
foreach (string dir in Directory.GetDirectories(sourceDir))
|
||||
{
|
||||
string dirName = Path.GetFileName(dir);
|
||||
string destDir = Path.Combine(targetDir, dirName);
|
||||
|
||||
if (!Directory.Exists(destDir))
|
||||
{
|
||||
Directory.CreateDirectory(destDir);
|
||||
}
|
||||
|
||||
CopyDirectory(dir, destDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00d9ffb1d338f3a47a581531161a43da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7ba47a303ab5a54aa50ce9e0ef18967
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b493b78c71ed7fe49951c8084f0f8b2a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,629 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
using System;
|
||||
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
|
||||
public unsafe struct AVRational2 : IFixedArray<AVRational>
|
||||
{
|
||||
public static readonly int ArrayLength = 2;
|
||||
public int Length => 2;
|
||||
AVRational _0; AVRational _1;
|
||||
|
||||
public AVRational this[uint i]
|
||||
{
|
||||
get { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational[] ToArray()
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { var a = new AVRational[2]; for (uint i = 0; i < 2; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational[] array)
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 2) return; } }
|
||||
}
|
||||
public static implicit operator AVRational[](AVRational2 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct short2 : IFixedArray<short>
|
||||
{
|
||||
public static readonly int ArrayLength = 2;
|
||||
public int Length => 2;
|
||||
fixed short _[2];
|
||||
|
||||
public short this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public short[] ToArray()
|
||||
{
|
||||
var a = new short[2]; for (uint i = 0; i < 2; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(short[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 2) return; }
|
||||
}
|
||||
public static implicit operator short[](short2 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct void_ptr2 : IFixedArray
|
||||
{
|
||||
public static readonly int ArrayLength = 2;
|
||||
public int Length => 2;
|
||||
void* _0; void* _1;
|
||||
|
||||
public void* this[uint i]
|
||||
{
|
||||
get { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (void** p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (void** p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public void*[] ToArray()
|
||||
{
|
||||
fixed (void** p0 = &_0) { var a = new void*[2]; for (uint i = 0; i < 2; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(void*[] array)
|
||||
{
|
||||
fixed (void** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 2) return; } }
|
||||
}
|
||||
public static implicit operator void*[](void_ptr2 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVHDRPlusColorTransformParams3 : IFixedArray<AVHDRPlusColorTransformParams>
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
AVHDRPlusColorTransformParams _0; AVHDRPlusColorTransformParams _1; AVHDRPlusColorTransformParams _2;
|
||||
|
||||
public AVHDRPlusColorTransformParams this[uint i]
|
||||
{
|
||||
get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusColorTransformParams* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusColorTransformParams* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVHDRPlusColorTransformParams[] ToArray()
|
||||
{
|
||||
fixed (AVHDRPlusColorTransformParams* p0 = &_0) { var a = new AVHDRPlusColorTransformParams[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVHDRPlusColorTransformParams[] array)
|
||||
{
|
||||
fixed (AVHDRPlusColorTransformParams* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } }
|
||||
}
|
||||
public static implicit operator AVHDRPlusColorTransformParams[](AVHDRPlusColorTransformParams3 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVRational3 : IFixedArray<AVRational>
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
AVRational _0; AVRational _1; AVRational _2;
|
||||
|
||||
public AVRational this[uint i]
|
||||
{
|
||||
get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational[] ToArray()
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { var a = new AVRational[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational[] array)
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } }
|
||||
}
|
||||
public static implicit operator AVRational[](AVRational3 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVRational3x2 : IFixedArray<AVRational2>
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
AVRational2 _0; AVRational2 _1; AVRational2 _2;
|
||||
|
||||
public AVRational2 this[uint i]
|
||||
{
|
||||
get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational2* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational2* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational2[] ToArray()
|
||||
{
|
||||
fixed (AVRational2* p0 = &_0) { var a = new AVRational2[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational2[] array)
|
||||
{
|
||||
fixed (AVRational2* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } }
|
||||
}
|
||||
public static implicit operator AVRational2[](AVRational3x2 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte_ptr3 : IFixedArray
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
byte* _0; byte* _1; byte* _2;
|
||||
|
||||
public byte* this[uint i]
|
||||
{
|
||||
get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public byte*[] ToArray()
|
||||
{
|
||||
fixed (byte** p0 = &_0) { var a = new byte*[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(byte*[] array)
|
||||
{
|
||||
fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } }
|
||||
}
|
||||
public static implicit operator byte*[](byte_ptr3 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct int3 : IFixedArray<int>
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
fixed int _[3];
|
||||
|
||||
public int this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public int[] ToArray()
|
||||
{
|
||||
var a = new int[3]; for (uint i = 0; i < 3; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(int[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 3) return; }
|
||||
}
|
||||
public static implicit operator int[](int3 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct short3x2 : IFixedArray<short2>
|
||||
{
|
||||
public static readonly int ArrayLength = 3;
|
||||
public int Length => 3;
|
||||
short2 _0; short2 _1; short2 _2;
|
||||
|
||||
public short2 this[uint i]
|
||||
{
|
||||
get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (short2* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (short2* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public short2[] ToArray()
|
||||
{
|
||||
fixed (short2* p0 = &_0) { var a = new short2[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(short2[] array)
|
||||
{
|
||||
fixed (short2* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } }
|
||||
}
|
||||
public static implicit operator short2[](short3x2 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVComponentDescriptor4 : IFixedArray<AVComponentDescriptor>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
AVComponentDescriptor _0; AVComponentDescriptor _1; AVComponentDescriptor _2; AVComponentDescriptor _3;
|
||||
|
||||
public AVComponentDescriptor this[uint i]
|
||||
{
|
||||
get { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (AVComponentDescriptor* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (AVComponentDescriptor* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVComponentDescriptor[] ToArray()
|
||||
{
|
||||
fixed (AVComponentDescriptor* p0 = &_0) { var a = new AVComponentDescriptor[4]; for (uint i = 0; i < 4; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVComponentDescriptor[] array)
|
||||
{
|
||||
fixed (AVComponentDescriptor* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 4) return; } }
|
||||
}
|
||||
public static implicit operator AVComponentDescriptor[](AVComponentDescriptor4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte_ptr4 : IFixedArray
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
byte* _0; byte* _1; byte* _2; byte* _3;
|
||||
|
||||
public byte* this[uint i]
|
||||
{
|
||||
get { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public byte*[] ToArray()
|
||||
{
|
||||
fixed (byte** p0 = &_0) { var a = new byte*[4]; for (uint i = 0; i < 4; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(byte*[] array)
|
||||
{
|
||||
fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 4) return; } }
|
||||
}
|
||||
public static implicit operator byte*[](byte_ptr4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte4 : IFixedArray<byte>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
fixed byte _[4];
|
||||
|
||||
public byte this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public byte[] ToArray()
|
||||
{
|
||||
var a = new byte[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(byte[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; }
|
||||
}
|
||||
public static implicit operator byte[](byte4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct int4 : IFixedArray<int>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
fixed int _[4];
|
||||
|
||||
public int this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public int[] ToArray()
|
||||
{
|
||||
var a = new int[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(int[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; }
|
||||
}
|
||||
public static implicit operator int[](int4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct long4 : IFixedArray<long>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
fixed long _[4];
|
||||
|
||||
public long this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public long[] ToArray()
|
||||
{
|
||||
var a = new long[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(long[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; }
|
||||
}
|
||||
public static implicit operator long[](long4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct uint4 : IFixedArray<uint>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
fixed uint _[4];
|
||||
|
||||
public uint this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public uint[] ToArray()
|
||||
{
|
||||
var a = new uint[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(uint[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; }
|
||||
}
|
||||
public static implicit operator uint[](uint4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct ulong4 : IFixedArray<ulong>
|
||||
{
|
||||
public static readonly int ArrayLength = 4;
|
||||
public int Length => 4;
|
||||
fixed ulong _[4];
|
||||
|
||||
public ulong this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public ulong[] ToArray()
|
||||
{
|
||||
var a = new ulong[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(ulong[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; }
|
||||
}
|
||||
public static implicit operator ulong[](ulong4 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct int7 : IFixedArray<int>
|
||||
{
|
||||
public static readonly int ArrayLength = 7;
|
||||
public int Length => 7;
|
||||
fixed int _[7];
|
||||
|
||||
public int this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public int[] ToArray()
|
||||
{
|
||||
var a = new int[7]; for (uint i = 0; i < 7; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(int[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 7) return; }
|
||||
}
|
||||
public static implicit operator int[](int7 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVBufferRef_ptr8 : IFixedArray
|
||||
{
|
||||
public static readonly int ArrayLength = 8;
|
||||
public int Length => 8;
|
||||
AVBufferRef* _0; AVBufferRef* _1; AVBufferRef* _2; AVBufferRef* _3; AVBufferRef* _4; AVBufferRef* _5; AVBufferRef* _6; AVBufferRef* _7;
|
||||
|
||||
public AVBufferRef* this[uint i]
|
||||
{
|
||||
get { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (AVBufferRef** p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (AVBufferRef** p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVBufferRef*[] ToArray()
|
||||
{
|
||||
fixed (AVBufferRef** p0 = &_0) { var a = new AVBufferRef*[8]; for (uint i = 0; i < 8; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVBufferRef*[] array)
|
||||
{
|
||||
fixed (AVBufferRef** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 8) return; } }
|
||||
}
|
||||
public static implicit operator AVBufferRef*[](AVBufferRef_ptr8 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte_ptr8 : IFixedArray
|
||||
{
|
||||
public static readonly int ArrayLength = 8;
|
||||
public int Length => 8;
|
||||
byte* _0; byte* _1; byte* _2; byte* _3; byte* _4; byte* _5; byte* _6; byte* _7;
|
||||
|
||||
public byte* this[uint i]
|
||||
{
|
||||
get { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public byte*[] ToArray()
|
||||
{
|
||||
fixed (byte** p0 = &_0) { var a = new byte*[8]; for (uint i = 0; i < 8; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(byte*[] array)
|
||||
{
|
||||
fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 8) return; } }
|
||||
}
|
||||
public static implicit operator byte*[](byte_ptr8 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte8 : IFixedArray<byte>
|
||||
{
|
||||
public static readonly int ArrayLength = 8;
|
||||
public int Length => 8;
|
||||
fixed byte _[8];
|
||||
|
||||
public byte this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public byte[] ToArray()
|
||||
{
|
||||
var a = new byte[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(byte[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; }
|
||||
}
|
||||
public static implicit operator byte[](byte8 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct int8 : IFixedArray<int>
|
||||
{
|
||||
public static readonly int ArrayLength = 8;
|
||||
public int Length => 8;
|
||||
fixed int _[8];
|
||||
|
||||
public int this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public int[] ToArray()
|
||||
{
|
||||
var a = new int[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(int[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; }
|
||||
}
|
||||
public static implicit operator int[](int8 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct ulong8 : IFixedArray<ulong>
|
||||
{
|
||||
public static readonly int ArrayLength = 8;
|
||||
public int Length => 8;
|
||||
fixed ulong _[8];
|
||||
|
||||
public ulong this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public ulong[] ToArray()
|
||||
{
|
||||
var a = new ulong[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(ulong[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; }
|
||||
}
|
||||
public static implicit operator ulong[](ulong8 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct int9 : IFixedArray<int>
|
||||
{
|
||||
public static readonly int ArrayLength = 9;
|
||||
public int Length => 9;
|
||||
fixed int _[9];
|
||||
|
||||
public int this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public int[] ToArray()
|
||||
{
|
||||
var a = new int[9]; for (uint i = 0; i < 9; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(int[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 9) return; }
|
||||
}
|
||||
public static implicit operator int[](int9 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVHDRPlusPercentile15 : IFixedArray<AVHDRPlusPercentile>
|
||||
{
|
||||
public static readonly int ArrayLength = 15;
|
||||
public int Length => 15;
|
||||
AVHDRPlusPercentile _0; AVHDRPlusPercentile _1; AVHDRPlusPercentile _2; AVHDRPlusPercentile _3; AVHDRPlusPercentile _4; AVHDRPlusPercentile _5; AVHDRPlusPercentile _6; AVHDRPlusPercentile _7; AVHDRPlusPercentile _8; AVHDRPlusPercentile _9; AVHDRPlusPercentile _10; AVHDRPlusPercentile _11; AVHDRPlusPercentile _12; AVHDRPlusPercentile _13; AVHDRPlusPercentile _14;
|
||||
|
||||
public AVHDRPlusPercentile this[uint i]
|
||||
{
|
||||
get { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusPercentile* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusPercentile* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVHDRPlusPercentile[] ToArray()
|
||||
{
|
||||
fixed (AVHDRPlusPercentile* p0 = &_0) { var a = new AVHDRPlusPercentile[15]; for (uint i = 0; i < 15; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVHDRPlusPercentile[] array)
|
||||
{
|
||||
fixed (AVHDRPlusPercentile* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 15) return; } }
|
||||
}
|
||||
public static implicit operator AVHDRPlusPercentile[](AVHDRPlusPercentile15 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVRational15 : IFixedArray<AVRational>
|
||||
{
|
||||
public static readonly int ArrayLength = 15;
|
||||
public int Length => 15;
|
||||
AVRational _0; AVRational _1; AVRational _2; AVRational _3; AVRational _4; AVRational _5; AVRational _6; AVRational _7; AVRational _8; AVRational _9; AVRational _10; AVRational _11; AVRational _12; AVRational _13; AVRational _14;
|
||||
|
||||
public AVRational this[uint i]
|
||||
{
|
||||
get { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational[] ToArray()
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { var a = new AVRational[15]; for (uint i = 0; i < 15; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational[] array)
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 15) return; } }
|
||||
}
|
||||
public static implicit operator AVRational[](AVRational15 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct byte16 : IFixedArray<byte>
|
||||
{
|
||||
public static readonly int ArrayLength = 16;
|
||||
public int Length => 16;
|
||||
fixed byte _[16];
|
||||
|
||||
public byte this[uint i]
|
||||
{
|
||||
get => _[i];
|
||||
set => _[i] = value;
|
||||
}
|
||||
public byte[] ToArray()
|
||||
{
|
||||
var a = new byte[16]; for (uint i = 0; i < 16; i++) a[i] = _[i]; return a;
|
||||
}
|
||||
public void UpdateFrom(byte[] array)
|
||||
{
|
||||
uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 16) return; }
|
||||
}
|
||||
public static implicit operator byte[](byte16 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVRational25 : IFixedArray<AVRational>
|
||||
{
|
||||
public static readonly int ArrayLength = 25;
|
||||
public int Length => 25;
|
||||
AVRational _0; AVRational _1; AVRational _2; AVRational _3; AVRational _4; AVRational _5; AVRational _6; AVRational _7; AVRational _8; AVRational _9; AVRational _10; AVRational _11; AVRational _12; AVRational _13; AVRational _14; AVRational _15; AVRational _16; AVRational _17; AVRational _18; AVRational _19; AVRational _20; AVRational _21; AVRational _22; AVRational _23; AVRational _24;
|
||||
|
||||
public AVRational this[uint i]
|
||||
{
|
||||
get { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational[] ToArray()
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { var a = new AVRational[25]; for (uint i = 0; i < 25; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational[] array)
|
||||
{
|
||||
fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 25) return; } }
|
||||
}
|
||||
public static implicit operator AVRational[](AVRational25 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
public unsafe struct AVRational25x25 : IFixedArray<AVRational25>
|
||||
{
|
||||
public static readonly int ArrayLength = 25;
|
||||
public int Length => 25;
|
||||
AVRational25 _0; AVRational25 _1; AVRational25 _2; AVRational25 _3; AVRational25 _4; AVRational25 _5; AVRational25 _6; AVRational25 _7; AVRational25 _8; AVRational25 _9; AVRational25 _10; AVRational25 _11; AVRational25 _12; AVRational25 _13; AVRational25 _14; AVRational25 _15; AVRational25 _16; AVRational25 _17; AVRational25 _18; AVRational25 _19; AVRational25 _20; AVRational25 _21; AVRational25 _22; AVRational25 _23; AVRational25 _24;
|
||||
|
||||
public AVRational25 this[uint i]
|
||||
{
|
||||
get { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational25* p0 = &_0) { return *(p0 + i); } }
|
||||
set { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational25* p0 = &_0) { *(p0 + i) = value; } }
|
||||
}
|
||||
public AVRational25[] ToArray()
|
||||
{
|
||||
fixed (AVRational25* p0 = &_0) { var a = new AVRational25[25]; for (uint i = 0; i < 25; i++) a[i] = *(p0 + i); return a; }
|
||||
}
|
||||
public void UpdateFrom(AVRational25[] array)
|
||||
{
|
||||
fixed (AVRational25* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 25) return; } }
|
||||
}
|
||||
public static implicit operator AVRational25[](AVRational25x25 @struct) => @struct.ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8672a701b738a1c409125f98c38b79d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
|
||||
public class ConstCharPtrMarshaler : ICustomMarshaler
|
||||
{
|
||||
private static readonly ConstCharPtrMarshaler Instance = new ConstCharPtrMarshaler();
|
||||
public object MarshalNativeToManaged(IntPtr pNativeData) => Marshal.PtrToStringAnsi(pNativeData);
|
||||
|
||||
public IntPtr MarshalManagedToNative(object managedObj) => IntPtr.Zero;
|
||||
|
||||
public void CleanUpNativeData(IntPtr pNativeData)
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUpManagedData(object managedObj)
|
||||
{
|
||||
}
|
||||
|
||||
public int GetNativeDataSize() => IntPtr.Size;
|
||||
|
||||
public static ICustomMarshaler GetInstance(string cookie) => Instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6182afb215f53b409c298aeb135d0a9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,460 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int _query_func(AVFilterContext* @p0);
|
||||
public unsafe struct _query_func_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator _query_func_func(_query_func func) => new _query_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void av_buffer_create_free(void* @opaque, byte* @data);
|
||||
public unsafe struct av_buffer_create_free_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_buffer_create_free_func(av_buffer_create_free func) => new av_buffer_create_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate AVBufferRef* av_buffer_pool_init_alloc(ulong @size);
|
||||
public unsafe struct av_buffer_pool_init_alloc_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_buffer_pool_init_alloc_func(av_buffer_pool_init_alloc func) => new av_buffer_pool_init_alloc_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate AVBufferRef* av_buffer_pool_init2_alloc(void* @opaque, ulong @size);
|
||||
public unsafe struct av_buffer_pool_init2_alloc_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_buffer_pool_init2_alloc_func(av_buffer_pool_init2_alloc func) => new av_buffer_pool_init2_alloc_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void av_buffer_pool_init2_pool_free(void* @opaque);
|
||||
public unsafe struct av_buffer_pool_init2_pool_free_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_buffer_pool_init2_pool_free_func(av_buffer_pool_init2_pool_free func) => new av_buffer_pool_init2_pool_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void av_log_set_callback_callback(void* @p0, int @p1,
|
||||
#if NETSTANDARD2_1_OR_GREATER
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)]
|
||||
#else
|
||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]
|
||||
#endif
|
||||
string @p2, byte* @p3);
|
||||
public unsafe struct av_log_set_callback_callback_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_log_set_callback_callback_func(av_log_set_callback_callback func) => new av_log_set_callback_callback_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int av_tree_enumerate_cmp(void* @opaque, void* @elem);
|
||||
public unsafe struct av_tree_enumerate_cmp_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_tree_enumerate_cmp_func(av_tree_enumerate_cmp func) => new av_tree_enumerate_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int av_tree_enumerate_enu(void* @opaque, void* @elem);
|
||||
public unsafe struct av_tree_enumerate_enu_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_tree_enumerate_enu_func(av_tree_enumerate_enu func) => new av_tree_enumerate_enu_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int av_tree_find_cmp(void* @key, void* @b);
|
||||
public unsafe struct av_tree_find_cmp_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_tree_find_cmp_func(av_tree_find_cmp func) => new av_tree_find_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int av_tree_insert_cmp(void* @key, void* @b);
|
||||
public unsafe struct av_tree_insert_cmp_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator av_tree_insert_cmp_func(av_tree_insert_cmp func) => new av_tree_insert_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate AVClass* AVClass_child_class_iterate(void** @iter);
|
||||
public unsafe struct AVClass_child_class_iterate_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVClass_child_class_iterate_func(AVClass_child_class_iterate func) => new AVClass_child_class_iterate_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void* AVClass_child_next(void* @obj, void* @prev);
|
||||
public unsafe struct AVClass_child_next_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVClass_child_next_func(AVClass_child_next func) => new AVClass_child_next_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate AVClassCategory AVClass_get_category(void* @ctx);
|
||||
public unsafe struct AVClass_get_category_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVClass_get_category_func(AVClass_get_category func) => new AVClass_get_category_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate string AVClass_item_name(void* @ctx);
|
||||
public unsafe struct AVClass_item_name_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVClass_item_name_func(AVClass_item_name func) => new AVClass_item_name_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVClass_query_ranges(AVOptionRanges** @p0, void* @obj,
|
||||
#if NETSTANDARD2_1_OR_GREATER
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)]
|
||||
#else
|
||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]
|
||||
#endif
|
||||
string @key, int @flags);
|
||||
public unsafe struct AVClass_query_ranges_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVClass_query_ranges_func(AVClass_query_ranges func) => new AVClass_query_ranges_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int avcodec_default_execute_func(AVCodecContext* @c2, void* @arg2);
|
||||
public unsafe struct avcodec_default_execute_func_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator avcodec_default_execute_func_func(avcodec_default_execute_func func) => new avcodec_default_execute_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int avcodec_default_execute2_func(AVCodecContext* @c2, void* @arg2, int @p2, int @p3);
|
||||
public unsafe struct avcodec_default_execute2_func_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator avcodec_default_execute2_func_func(avcodec_default_execute2_func func) => new avcodec_default_execute2_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVCodecContext_draw_horiz_band(AVCodecContext* @s, AVFrame* @src, ref int8 @offset, int @y, int @type, int @height);
|
||||
public unsafe struct AVCodecContext_draw_horiz_band_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_draw_horiz_band_func(AVCodecContext_draw_horiz_band func) => new AVCodecContext_draw_horiz_band_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecContext_execute(AVCodecContext* @c, func_func @func, void* @arg2, int* @ret, int @count, int @size);
|
||||
public unsafe struct AVCodecContext_execute_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_execute_func(AVCodecContext_execute func) => new AVCodecContext_execute_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecContext_execute2(AVCodecContext* @c, func_func @func, void* @arg2, int* @ret, int @count);
|
||||
public unsafe struct AVCodecContext_execute2_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_execute2_func(AVCodecContext_execute2 func) => new AVCodecContext_execute2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecContext_get_buffer2(AVCodecContext* @s, AVFrame* @frame, int @flags);
|
||||
public unsafe struct AVCodecContext_get_buffer2_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_get_buffer2_func(AVCodecContext_get_buffer2 func) => new AVCodecContext_get_buffer2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecContext_get_encode_buffer(AVCodecContext* @s, AVPacket* @pkt, int @flags);
|
||||
public unsafe struct AVCodecContext_get_encode_buffer_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_get_encode_buffer_func(AVCodecContext_get_encode_buffer func) => new AVCodecContext_get_encode_buffer_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate AVPixelFormat AVCodecContext_get_format(AVCodecContext* @s, AVPixelFormat* @fmt);
|
||||
public unsafe struct AVCodecContext_get_format_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecContext_get_format_func(AVCodecContext_get_format func) => new AVCodecContext_get_format_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVCodecParser_parser_close(AVCodecParserContext* @s);
|
||||
public unsafe struct AVCodecParser_parser_close_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecParser_parser_close_func(AVCodecParser_parser_close func) => new AVCodecParser_parser_close_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecParser_parser_init(AVCodecParserContext* @s);
|
||||
public unsafe struct AVCodecParser_parser_init_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecParser_parser_init_func(AVCodecParser_parser_init func) => new AVCodecParser_parser_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecParser_parser_parse(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size);
|
||||
public unsafe struct AVCodecParser_parser_parse_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecParser_parser_parse_func(AVCodecParser_parser_parse func) => new AVCodecParser_parser_parse_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVCodecParser_split(AVCodecContext* @avctx, byte* @buf, int @buf_size);
|
||||
public unsafe struct AVCodecParser_split_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVCodecParser_split_func(AVCodecParser_split func) => new AVCodecParser_split_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVD3D11VADeviceContext_lock(void* @lock_ctx);
|
||||
public unsafe struct AVD3D11VADeviceContext_lock_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVD3D11VADeviceContext_lock_func(AVD3D11VADeviceContext_lock func) => new AVD3D11VADeviceContext_lock_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVD3D11VADeviceContext_unlock(void* @lock_ctx);
|
||||
public unsafe struct AVD3D11VADeviceContext_unlock_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVD3D11VADeviceContext_unlock_func(AVD3D11VADeviceContext_unlock func) => new AVD3D11VADeviceContext_unlock_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFilter_activate(AVFilterContext* @ctx);
|
||||
public unsafe struct AVFilter_activate_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilter_activate_func(AVFilter_activate func) => new AVFilter_activate_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFilter_init(AVFilterContext* @ctx);
|
||||
public unsafe struct AVFilter_init_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilter_init_func(AVFilter_init func) => new AVFilter_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFilter_preinit(AVFilterContext* @ctx);
|
||||
public unsafe struct AVFilter_preinit_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilter_preinit_func(AVFilter_preinit func) => new AVFilter_preinit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFilter_process_command(AVFilterContext* @p0,
|
||||
#if NETSTANDARD2_1_OR_GREATER
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)]
|
||||
#else
|
||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]
|
||||
#endif
|
||||
string @cmd,
|
||||
#if NETSTANDARD2_1_OR_GREATER
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)]
|
||||
#else
|
||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]
|
||||
#endif
|
||||
string @arg, byte* @res, int @res_len, int @flags);
|
||||
public unsafe struct AVFilter_process_command_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilter_process_command_func(AVFilter_process_command func) => new AVFilter_process_command_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVFilter_uninit(AVFilterContext* @ctx);
|
||||
public unsafe struct AVFilter_uninit_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilter_uninit_func(AVFilter_uninit func) => new AVFilter_uninit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFilterGraph_execute(AVFilterContext* @ctx, func_func @func, void* @arg, int* @ret, int @nb_jobs);
|
||||
public unsafe struct AVFilterGraph_execute_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFilterGraph_execute_func(AVFilterGraph_execute func) => new AVFilterGraph_execute_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFormatContext_control_message_cb(AVFormatContext* @s, int @type, void* @data, ulong @data_size);
|
||||
public unsafe struct AVFormatContext_control_message_cb_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFormatContext_control_message_cb_func(AVFormatContext_control_message_cb func) => new AVFormatContext_control_message_cb_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFormatContext_io_close2(AVFormatContext* @s, AVIOContext* @pb);
|
||||
public unsafe struct AVFormatContext_io_close2_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFormatContext_io_close2_func(AVFormatContext_io_close2 func) => new AVFormatContext_io_close2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVFormatContext_io_open(AVFormatContext* @s, AVIOContext** @pb,
|
||||
#if NETSTANDARD2_1_OR_GREATER
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)]
|
||||
#else
|
||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))]
|
||||
#endif
|
||||
string @url, int @flags, AVDictionary** @options);
|
||||
public unsafe struct AVFormatContext_io_open_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVFormatContext_io_open_func(AVFormatContext_io_open func) => new AVFormatContext_io_open_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVHWDeviceContext_free(AVHWDeviceContext* @ctx);
|
||||
public unsafe struct AVHWDeviceContext_free_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVHWDeviceContext_free_func(AVHWDeviceContext_free func) => new AVHWDeviceContext_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void AVHWFramesContext_free(AVHWFramesContext* @ctx);
|
||||
public unsafe struct AVHWFramesContext_free_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVHWFramesContext_free_func(AVHWFramesContext_free func) => new AVHWFramesContext_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int avio_alloc_context_read_packet(void* @opaque, byte* @buf, int @buf_size);
|
||||
public unsafe struct avio_alloc_context_read_packet_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator avio_alloc_context_read_packet_func(avio_alloc_context_read_packet func) => new avio_alloc_context_read_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate long avio_alloc_context_seek(void* @opaque, long @offset, int @whence);
|
||||
public unsafe struct avio_alloc_context_seek_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator avio_alloc_context_seek_func(avio_alloc_context_seek func) => new avio_alloc_context_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int avio_alloc_context_write_packet(void* @opaque, byte* @buf, int @buf_size);
|
||||
public unsafe struct avio_alloc_context_write_packet_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator avio_alloc_context_write_packet_func(avio_alloc_context_write_packet func) => new avio_alloc_context_write_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVIOContext_read_packet(void* @opaque, byte* @buf, int @buf_size);
|
||||
public unsafe struct AVIOContext_read_packet_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_read_packet_func(AVIOContext_read_packet func) => new AVIOContext_read_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVIOContext_read_pause(void* @opaque, int @pause);
|
||||
public unsafe struct AVIOContext_read_pause_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_read_pause_func(AVIOContext_read_pause func) => new AVIOContext_read_pause_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate long AVIOContext_read_seek(void* @opaque, int @stream_index, long @timestamp, int @flags);
|
||||
public unsafe struct AVIOContext_read_seek_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_read_seek_func(AVIOContext_read_seek func) => new AVIOContext_read_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate long AVIOContext_seek(void* @opaque, long @offset, int @whence);
|
||||
public unsafe struct AVIOContext_seek_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_seek_func(AVIOContext_seek func) => new AVIOContext_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate ulong AVIOContext_update_checksum(ulong @checksum, byte* @buf, uint @size);
|
||||
public unsafe struct AVIOContext_update_checksum_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_update_checksum_func(AVIOContext_update_checksum func) => new AVIOContext_update_checksum_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVIOContext_write_data_type(void* @opaque, byte* @buf, int @buf_size, AVIODataMarkerType @type, long @time);
|
||||
public unsafe struct AVIOContext_write_data_type_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_write_data_type_func(AVIOContext_write_data_type func) => new AVIOContext_write_data_type_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVIOContext_write_packet(void* @opaque, byte* @buf, int @buf_size);
|
||||
public unsafe struct AVIOContext_write_packet_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOContext_write_packet_func(AVIOContext_write_packet func) => new AVIOContext_write_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int AVIOInterruptCB_callback(void* @p0);
|
||||
public unsafe struct AVIOInterruptCB_callback_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator AVIOInterruptCB_callback_func(AVIOInterruptCB_callback func) => new AVIOInterruptCB_callback_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int func(AVFilterContext* @ctx, void* @arg, int @jobnr, int @nb_jobs);
|
||||
public unsafe struct func_func
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
public static implicit operator func_func(func func) => new func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) };
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6494f6467575f8f4686755f1fb403a78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c64159813b5056848bf146c573693369
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
public interface IFixedArray
|
||||
{
|
||||
int Length { get; }
|
||||
}
|
||||
|
||||
internal interface IFixedArray<T> : IFixedArray
|
||||
{
|
||||
T this[uint index] { get; set; }
|
||||
T[] ToArray();
|
||||
void UpdateFrom(T[] array);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 831fd920f1934bd46a5a38037ddf74b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Leviathan.Core",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1d67e105160e074c99d37c9215900e1
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
using System;
|
||||
using Unity.Collections.LowLevel.Unsafe;
|
||||
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
|
||||
public static partial class leviathan
|
||||
{
|
||||
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS
|
||||
public static readonly int EAGAIN = 35;
|
||||
public static readonly int ENOMEM = 12;
|
||||
public static readonly int EINVAL = 22;
|
||||
#elif UNITY_WEBGL && !UNITY_EDITOR
|
||||
public static readonly int EAGAIN = 6;
|
||||
public static readonly int ENOMEM = 48;
|
||||
public static readonly int EINVAL = 28;
|
||||
#else
|
||||
public static readonly int EAGAIN = 11;
|
||||
public static readonly int ENOMEM = 12;
|
||||
public static readonly int EINVAL = 22;
|
||||
#endif
|
||||
|
||||
// public static readonly int EPIPE = 32;
|
||||
|
||||
public static ulong UINT64_C<T>(T a)
|
||||
=> Convert.ToUInt64(a);
|
||||
|
||||
public static int AVERROR_Enum<T1>(T1 a) where T1 : struct, IConvertible => -UnsafeUtility.EnumToInt(a);
|
||||
|
||||
public static int AVERROR<T1>(T1 a)
|
||||
=> -Convert.ToInt32(a);
|
||||
|
||||
public static int MKTAG<T1, T2, T3, T4>(T1 a, T2 b, T3 c, T4 d)
|
||||
=> (int)(Convert.ToUInt32(a) | (Convert.ToUInt32(b) << 8) | (Convert.ToUInt32(c) << 16) |
|
||||
(Convert.ToUInt32(d) << 24));
|
||||
|
||||
public static int FFERRTAG<T1, T2, T3, T4>(T1 a, T2 b, T3 c, T4 d)
|
||||
=> -MKTAG(a, b, c, d);
|
||||
|
||||
public static int AV_VERSION_INT<T1, T2, T3>(T1 a, T2 b, T3 c) =>
|
||||
(Convert.ToInt32(a) << 16) | (Convert.ToInt32(b) << 8) | Convert.ToInt32(c);
|
||||
|
||||
public static string AV_VERSION_DOT<T1, T2, T3>(T1 a, T2 b, T3 c)
|
||||
=> $"{a}.{b}.{c}";
|
||||
|
||||
public static string AV_VERSION<T1, T2, T3>(T1 a, T2 b, T3 c)
|
||||
=> AV_VERSION_DOT(a, b, c);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebc87a006120f7d4e8ac1faf1284562e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac98c4f0ef273194db7db58423be559f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25e968c51067fb54a85f6052c03f6bcc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,91 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace LeviathanVideo.Abstractions
|
||||
{
|
||||
|
||||
public class UTF8Marshaler : ICustomMarshaler
|
||||
{
|
||||
private static readonly UTF8Marshaler Instance = new UTF8Marshaler();
|
||||
|
||||
public virtual object MarshalNativeToManaged(IntPtr pNativeData) => FromNative(Encoding.UTF8, pNativeData);
|
||||
|
||||
public virtual IntPtr MarshalManagedToNative(object managedObj)
|
||||
{
|
||||
if (managedObj == null)
|
||||
return IntPtr.Zero;
|
||||
|
||||
if (!(managedObj is string str))
|
||||
throw new MarshalDirectiveException($"{GetType().Name} must be used on a string.");
|
||||
|
||||
return FromManaged(Encoding.UTF8, str);
|
||||
}
|
||||
|
||||
public virtual void CleanUpNativeData(IntPtr pNativeData)
|
||||
{
|
||||
//Free anything allocated by MarshalManagedToNative
|
||||
//This is called after the native function call completes
|
||||
|
||||
if (pNativeData != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal(pNativeData);
|
||||
}
|
||||
|
||||
public void CleanUpManagedData(object managedObj)
|
||||
{
|
||||
//Free anything allocated by MarshalNativeToManaged
|
||||
//This is called after the native function call completes
|
||||
}
|
||||
|
||||
public int GetNativeDataSize() => -1; // Not a value type
|
||||
|
||||
public static ICustomMarshaler GetInstance(string cookie) => Instance;
|
||||
|
||||
public static unsafe string FromNative(Encoding encoding, IntPtr pNativeData) => FromNative(encoding, (byte*)pNativeData);
|
||||
|
||||
public static unsafe string FromNative(Encoding encoding, byte* pNativeData)
|
||||
{
|
||||
if (pNativeData == null)
|
||||
return null;
|
||||
|
||||
var start = pNativeData;
|
||||
var walk = start;
|
||||
|
||||
// Find the end of the string
|
||||
while (*walk != 0) walk++;
|
||||
|
||||
if (walk == start)
|
||||
return string.Empty;
|
||||
|
||||
return new string((sbyte*)pNativeData, 0, (int)(walk - start), encoding);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr FromManaged(Encoding encoding, string value)
|
||||
{
|
||||
if (encoding == null || value == null)
|
||||
return IntPtr.Zero;
|
||||
|
||||
var length = encoding.GetByteCount(value);
|
||||
var buffer = (byte*)Marshal.AllocHGlobal(length + 1).ToPointer();
|
||||
|
||||
if (length > 0)
|
||||
{
|
||||
fixed (char* pValue = value)
|
||||
{
|
||||
encoding.GetBytes(pValue, value.Length, buffer, length);
|
||||
}
|
||||
}
|
||||
|
||||
buffer[length] = 0;
|
||||
|
||||
return new IntPtr(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d3fb0a766a91b74782afd15644bd45b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5804ddd88f687945bf3886c41d4a565
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user