| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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
- }
- #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();
- #endif
- }
- }
|