1. 小游戏sdk: Assets/Plugins/IvyMiniGame/
2. IvySDK: Assets/Plugins/IvySdk/
3. 工具: Assets/Plugins/Utils/
4. 抖音sdk: Assets/Plugins/ByteGame/
- Package方式安装 打开游戏工程 -> Unity Editor 菜单栏 -> Package Manager -> 右上方“+” -> Add Package from git URL URL 地址为:
https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git
详细文档请参考
https://gitee.com/wechat-minigame/minigame-unity-webgl-transform#/wechat-minigame/minigame-unity-webgl-transform/blob/main/Design/SDKInstaller.md
IvySdk.Instance.Login((data) => {
//登陆成功
}, (err) => {
//登陆失败
});
IvySdk.Instance.IsLogin((state) =>
{
});
IvySdk.Instance.IsLogin((state) =>
{
if(!state){
IvySdk.Instance.Login((data) => {
//登陆成功
}, (err) => {
//登陆失败
});
}
});
string str = IvySdk.Instance.LoggedUser();
{
"logInfo":{
"openId":"",
"unionId":""
}
}
计费点信息需要提前录入管理后台,否则拉起支付时会出现异常,请联系运营人员录入
string str = IvySdk.Instance.GetPaymentData(billId);
IvySdk.Instance.Pay(billId);
string str = IvySdk.Instance.Pay(billId, payload);
IvySdkListener.OnPaymentEvent += (IvySdk.PaymentResult result, int i, string str) =>
{
Ivy.Utils.Log.Print($"pay result::{result} {i} {str}");
};
IvySdkListener.OnPaymentWithPayloadEvent += (IvySdk.PaymentResult result, int i, string str, string str1) =>
{
Ivy.Utils.Log.Print($"pay result::{result} {i} {str} {str1}");
};
请参考示例中的 payConfig.json
{
"data":[
{
"payId":"1",
"name":"1元礼包",
"skuId":"fun.photonfox.cn.goods.p0017",
"price":100,
"description":"一小包好东西",
"imageUrl":"https://tcdng001.photonfox.cn/WebShop/images/gift_pack_small.png"
},
{
"payId":"2",
"name":"6元礼包",
"skuId":"fun.photonfox.cn.goods.p0099",
"price":600,
"description":"一小包好东西",
"imageUrl":"https://tcdng001.photonfox.cn/WebShop/images/gift_pack_small.png"
},
{
"payId":"3",
"name":"12元礼包",
"skuId":"fun.photonfox.cn.goods_01.p0199",
"price":1200,
"description":"一小包好东西",
"imageUrl":"https://tcdng001.photonfox.cn/WebShop/images/gift_pack_small.png"
}
]
}
IvySDK.Instance.ShowHelp();
bool state = IvySDK.Instance.IsIOSSystem();
IvySDK.Instance.LogEvent(string event, string keyValueData);
IvySdk.Instance.CallTencentCloudFunction(api_key, param, (data) =>
{
Ivy.Utils.Log.Print($"cloud func success:: data:{data}");
}, (api_key) =>
{
Ivy.Utils.Log.Print($"cloud func:: api:{api_key} failed");
});