sdk 代码合并
This commit is contained in:
@@ -4,16 +4,12 @@ using UnityEngine;
|
||||
namespace tysdk
|
||||
{
|
||||
|
||||
public enum EAccoutType
|
||||
{
|
||||
hwGoogle,
|
||||
hwFacebook,
|
||||
hwGuest,
|
||||
}
|
||||
|
||||
public static class UnityBridgeFunc
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//初始化sdk
|
||||
public static void InitSDK(){}
|
||||
|
||||
//更新登录支付域名
|
||||
public static void UnityResetServerUrl(string url){}
|
||||
|
||||
@@ -24,13 +20,20 @@ namespace tysdk
|
||||
public static void UnityGetIdentityFun(string type){}
|
||||
|
||||
public static void UnityLoginOut(){}
|
||||
//支付new
|
||||
public static void UnityKnowNew(string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo, string pType) { }
|
||||
|
||||
//支付
|
||||
public static void UnityKnow(string userId, string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo){}
|
||||
|
||||
//获取商品列表
|
||||
public static void ThirdExtend() { }
|
||||
|
||||
//打点
|
||||
public static void SetGaUserInfo(string userId){}
|
||||
|
||||
|
||||
public static void SetGaCommonInfo(string SetGaCommonInfo){}
|
||||
|
||||
@@ -49,11 +52,23 @@ namespace tysdk
|
||||
public static void UnityLoadRvADS(){}
|
||||
|
||||
public static void UnityShowRVAD(){}
|
||||
|
||||
|
||||
#elif UNITY_ANDROID
|
||||
|
||||
private static string SDK_CLASS = "com.unity3d.player.SDKManager";
|
||||
|
||||
//初始化sdk
|
||||
public static void InitSDK(){
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
using(var activityCls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
{
|
||||
var activity = activityCls.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
sdkManager.CallStatic("InitSDK", activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新登录支付域名
|
||||
public static void UnityResetServerUrl(string url)
|
||||
{
|
||||
@@ -108,6 +123,17 @@ namespace tysdk
|
||||
}
|
||||
}
|
||||
|
||||
//支付new
|
||||
public static void UnityKnowNew(string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo,string pType)
|
||||
{
|
||||
Debug.LogError("[UnityKnowNew] pType:" + pType);
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
sdkManager.CallStatic("UnityKnowNew", productId, productPrice, productName,
|
||||
productCount, prodorderId, appInfo,pType);
|
||||
}
|
||||
}
|
||||
//支付
|
||||
public static void UnityKnow(string userId, string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo)
|
||||
@@ -119,6 +145,15 @@ namespace tysdk
|
||||
}
|
||||
}
|
||||
|
||||
//获取商品列表
|
||||
public static void ThirdExtend()
|
||||
{
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
sdkManager.CallStatic("thirdExtend");
|
||||
}
|
||||
}
|
||||
|
||||
//打点
|
||||
public static void SetGaUserInfo(string userId)
|
||||
{
|
||||
@@ -205,6 +240,13 @@ namespace tysdk
|
||||
public static extern void UnityKnow(string userId, string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo);
|
||||
|
||||
//支付new
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityKnowNew(string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo, string pType);
|
||||
//获取商品列表
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ThirdExtend();
|
||||
//打点
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetGaUserInfo(string userId);
|
||||
|
||||
Reference in New Issue
Block a user