| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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)
- {
- #if UNITY_IOS
- QSDK_Pay( productId, productName, amount, orderNo,
- callBackUrl, extrasParams,
- gameName, serverName, productDesc);
- #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);
- [DllImport("__Internal")]
- private static extern void QSDK_logout();
- #endif
- }
- }
|