| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Runtime.InteropServices;
- namespace qsdk
- {
- public class QSdkMgr
- {
- public static QKSDKInitState InitState = QKSDKInitState.None;
- public static void SetListener(string listener)
- {
- #if UNITY_IOS
- QSDK_SetListener(listener);
- #endif
- }
- public static void Init()
- {
- #if UNITY_IOS
- QSDK_Init();
- #endif
- }
- public static void Login()
- {
- #if UNITY_IOS
- QSDK_login();
- #endif
- }
- public static void Pay(string productId, string productName, string amount, string orderNo,
- string callBackUrl, string extrasParams,
- string gameName, string serverName, string productDesc, string serverID, string accountID, string roleID, string roleLv)
- {
- #if UNITY_IOS
- QSDK_Pay( productId, productName, amount, orderNo,
- callBackUrl, extrasParams,
- gameName, serverName, productDesc,
- serverID,accountID,roleID,roleLv);
- #endif
- }
- public static void Logout()
- {
- #if UNITY_IOS
- QSDK_logout();
- #endif
- }
- public static void UpdateRoleInfo(int type,GameRoleInfo roleInfo,string extra)
- {
- #if UNITY_IOS
- QSDK_UpdateRoleInfo(type,roleInfo.roleName,roleInfo.roleId,roleInfo.roleLv.ToString(),roleInfo.serverName,roleInfo.serverId.ToString(),extra);
- #endif
- }
- #if UNITY_IOS
- [DllImport("__Internal")]
- private static extern void QSDK_SetListener(string callbackGoName);
- [DllImport("__Internal")]
- private static extern void QSDK_Init();
- [DllImport("__Internal")]
- private static extern void QSDK_login();
- [DllImport("__Internal")]
- private static extern void QSDK_Pay(string productId, string productName, string amount, string orderNo,
- string callBackUrl, string extrasParams,
- string gameName, string serverName, string productDesc,
- string serverID, string accountID, string roleID, string roleLv);
- [DllImport("__Internal")]
- private static extern void QSDK_logout();
- [DllImport("__Internal")]
- private static extern void QSDK_UpdateRoleInfo(int type,string roleName,string roleId,string roleLv, string serverName,string serverId,string extra);
- #endif
- }
- }
|