Browse Source

qk sdk 接入

123 1 year ago
parent
commit
7831cf46f0

+ 2 - 2
Assets/Editor/Pack/Platform/PackPlatformUnityBuild.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
@@ -102,7 +102,7 @@ namespace Pack
                 AssetDatabase.Refresh();
                 AssetDatabase.SaveAssets();
                 ChangeAssetsObscure();
-                AssetBundleMap.BuildAllAssetBundles(resVersionCode);
+                //AssetBundleMap.BuildAllAssetBundles(resVersionCode);----注释打包资源
                 if (Application.isBatchMode)
                 {
                     PackLog.Log(PackConstant.TAG_ResOutPath + BundleBuilderZ.GetAssetbundlesPath());

+ 5 - 5
Assets/Lua/Core/PlatformPack.lua

@@ -1,9 +1,9 @@
 local PlatformPack = {
-	URL_KEY = 'http://110.40.223.119:81//',
-	SERVERLIST_URL = 'http://110.40.223.119:81//serverlist',
-	NOTIFY_URL = 'http://165.154.29.92:88/res/NoticeNew/',
-	SPECIAL_INFO_URL = 'http://110.40.223.119:81//channel',
-	CUSTOMER_SERVICE_INFO_URL = 'http://110.40.223.119:81//vipService',
+	URL_KEY = 'http://101.43.46.101:81//',
+	SERVERLIST_URL = 'http://101.43.46.101:81//serverlist',
+	NOTIFY_URL = 'http://101.43.46.101:88//res/TestServerNotice/',
+	SPECIAL_INFO_URL = 'http://101.43.46.101:81//channel',
+	CUSTOMER_SERVICE_INFO_URL = 'http://101.43.46.101:81//vipService',
 }
 
 return PlatformPack

+ 0 - 8
Assets/Plugins/QuickSDK.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: fdfa3fd2216b9634fbff2dd1244f4db1
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 138
Assets/Plugins/QuickSDK/LoginKitListener.cs

@@ -1,138 +0,0 @@
-using UnityEngine;
-using System.Collections;
-#if UNITY_IOS
-namespace quicksdk
-{
-    // LoginKitLisener
-    public class LoginKitListener : MonoBehaviour
-    {
-        //callback
-        //public abstract void onInitSuccess(string msg);
-        //      public abstract void onLoginSuccess(string userInfo);
-        //public abstract void onBindSuccess(string userInfo);
-        //public abstract void onUnBindSuccess(string userInfo);
-        //      public abstract void onGameLogoutSuccess(string msg);
-        //      public abstract void onLogoutSuccess(string msg);
-        //      public abstract void onPurchaseSuccess(string orderInfos);
-        //      public abstract void onPurchaseFail();
-        //      public abstract void onRestoreSuccess(string products);
-        //      public abstract void onRestoreFail(string message);
-        //      public abstract void findProductInfoSuccess(string products);
-        //      public abstract void findProductInfoFail(string message);
-        //      //callback end
-
-        private YouYiListener m_YouYiListener;
-
-        public void InitListener(YouYiListener youYiListener)
-        {
-            m_YouYiListener = youYiListener;
-        }
-        public void onInitSuccess(string msg)
-        {
-            Debug.Log("QKSDK 初始化:"+ msg);
-            //执行初始化成功操作
-            if (msg == "Fail")
-            {
-                Debug.Log("QKSDK初始化失败");
-                QKGame.InitState = QKSDKInitState.Fail;
-                m_YouYiListener.OnInitFailed();
-            }
-            else
-            {
-                QKGame.InitState = QKSDKInitState.Success;
-                Debug.Log("QKSDK初始化成功");
-                m_YouYiListener.OnInitSuccess();
-            }
-               
-
-        }
-        public void onLoginSuccess(string userInfo)
-        {
-
-            var data = quickgame.SimpleJSON.JSONNode.Parse(userInfo);
-            //string uid = data["uid"].Value;
-            string token = data["token"].Value;
-            //string loginType = data["loginType"].Value;
-            //string isNewUser = data[@"isNewUser"].Value;
-            //string isGuest = data[@"isGuest"].Value;
-            //执行登录成功操作
-            m_YouYiListener.UID = data["uid"].Value;
-            m_YouYiListener.OnLoginSuccess(token);
-        }
-
-        public void onBindSuccess(string userInfo)
-        {
-
-            //var data = quickgame.SimpleJSON.JSONNode.Parse(userInfo);
-            //string uid = data["uid"].Value;
-            //string token = data["token"].Value;
-            //string type = data["type"].Value;
-            //执行绑定成功操作
-        }
-
-        public void onUnBindSuccess(string userInfo)
-        {
-            //var data = quickgame.SimpleJSON.JSONNode.Parse(userInfo);
-            //string uid = data["uid"].Value;
-            //string token = data["token"].Value;
-            //string type = data["type"].Value;
-            //执行解绑成功操作
-        }
-
-        public void onGameLogoutSuccess(string msg)
-        {
-            m_YouYiListener.OnLogoutSuccess();
-            //游戏主动调用logout操作完成回调
-        }
-
-        public void onLogoutSuccess(string msg)
-        {
-            m_YouYiListener.OnLogoutSuccess();
-            //玩家主动点击个人中心切换账号成功回调
-        }
-        public void onPurchaseSuccess(string orderInfos)
-        {
-            //var data = quickgame.SimpleJSON.JSONNode.Parse(orderInfos);
-            //string productId = data["productId"].Value;
-            //string orderNo = data["orderNo"].Value;
-            ////gameOrderNo可能为空字符串比如订阅品续订时
-            //string gameOrderNo = data["gameOrderNo"].Value;
-            //string receiptString = data["receiptString"].Value;
-            //购买成功回调
-            m_YouYiListener.OnPaySuccess();
-        }
-        public void onPurchaseFail()
-        {
-            //购买失败回调
-            m_YouYiListener.OnPayFailed();
-        }
-        public void onRestoreSuccess(string products)
-        {
-            //var data = quickgame.SimpleJSON.JSONNode.Parse(products);
-            //恢复Appstore订阅品购买成功回调
-        }
-        public void onRestoreFail(string msg)
-        {
-            //恢复Appstore订阅品购买失败回调
-        }
-        public void findProductInfoSuccess(string products)
-        {
-            //var listdata = quickgame.SimpleJSON.JSONNode.Parse(products);
-            //var data = listdata[0];
-            //string productId = data["productId"].Value;
-            //string productName = data["productName"].Value;
-            //string productDesc = data["productDesc"].Value;
-            //string price = data["price"].Value;
-            //string total = data["total"].Value;
-            //string extras_params = data["extras_params"].Value;
-            //从苹果服务器获取商品信息成功回调
-            Debug.Log("====================" + products);
-        }
-        public void findProductInfoFail(string msg)
-        {
-            //从苹果服务器获取商品信息失败回调
-            Debug.Log("====================从苹果服务器获取商品信息失败回调");
-        }
-    }
-}
-#endif

+ 0 - 250
Assets/Plugins/QuickSDK/QKGame.cs

@@ -1,250 +0,0 @@
-using UnityEngine;
-using System.Collections;
-using System.Runtime.InteropServices;
-//using Newtonsoft.Json;
-#if UNITY_IOS
-using quicksdk;
-using System.Collections.Generic;
-
-
-public enum QKSDKInitState
-{
-    None,
-    Initing,
-    Success,
-    Fail,
-}
-
-public class ProductInfo
-{
-    public string ID;
-    public string Name;
-}
-
-public class QKGame {
-
-    public static QKSDKInitState InitState = QKSDKInitState.None;
-
-    public Dictionary<string, ProductInfo> ProductInfos = new Dictionary<string, ProductInfo>()
-    {
-        { "0.99",new ProductInfo(){ ID = "intention0.99",Name = "0.99禮包"} },
-        { "1.99",new ProductInfo(){ ID = "intention1.99",Name = "1.99禮包"} },
-        { "2.99",new ProductInfo(){ ID = "intention2.99",Name = "2.99禮包"} },
-        { "4.99",new ProductInfo(){ ID = "intention4.99",Name = "4.99禮包"} },
-        { "9.99",new ProductInfo(){ ID = "intention9.99",Name = "9.99禮包"} },
-        { "14.99",new ProductInfo(){ ID = "intention14.99",Name = "14.99禮包"} },
-        { "19.99",new ProductInfo(){ ID = "intention19.99",Name = "19.99禮包"} },
-        { "49.99",new ProductInfo(){ ID = "intention49.99",Name = "49.99禮包"} },
-        { "99.99",new ProductInfo(){ ID = "intention99.99",Name = "99.99禮包"} },
-    };
-
-    [DllImport("__Internal")]
-    private static extern void LuluSetListener(string gameObjectName);
-    public void loginKitSetListener(LoginKitListener listener)
-    {
-        Debug.Log("gameObject is " + listener.gameObject.name);
-        if (listener == null)
-        {
-            Debug.LogError("set LoginKitListener error, listener is null");
-            return;
-        }
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            string gameObjectName = listener.gameObject.name;
-            LuluSetListener(gameObjectName);
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuInit();
-    //init
-    public static void txQKInit()
-    {     
-        if (Application.platform != RuntimePlatform.OSXEditor || InitState == QKSDKInitState.None || InitState == QKSDKInitState.Fail)
-        {
-            InitState = QKSDKInitState.Initing;
-            luLuInit();
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuLogin(bool isShowMenu);
-    //Login
-    public static void txQKLogin(bool isShowMenu)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor )
-        {  
-			luLuLogin(isShowMenu); 
-        }  
-     }
-    [DllImport("__Internal")]
-     private static extern void loginKitLoginWithType(int type);
-     //Login
-     public static void loginKitLoginWithType_Thread(int type)
-     {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            loginKitLoginWithType(type);
-        }
-     }
-     [DllImport("__Internal")]
-     private static extern void luLuFastStartGame();
-     //Login
-     public static void txQKFastStartGame()
-     {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuFastStartGame();
-        }
-     }
-     [DllImport("__Internal")]
-     private static extern string luLuGetUserBindInfo();
-     //luLuUserCenter
-     //public static Dictionary<string, int> loginkitGetUserBindInfo()
-     //{
-     //   if (Application.platform != RuntimePlatform.OSXEditor)
-     //   {
-     //       string jsonString = luLuGetUserBindInfo();
-     //       return JsonConvert.deserializeobject(jsonString);
-     //   }
-     //}
-     [DllImport("__Internal")]  
-     private static extern void luLuUserCenter();  
-     //luLuUserCenter
-     public static void txQKCenter()
-     {  
-        if (Application.platform != RuntimePlatform.OSXEditor)   
-        {  
-			luLuUserCenter(); 
-        }  
-     }
-	 [DllImport("__Internal")]
-	 private static extern void luLuLogout();
-	 //Logout
-	 public static void txQKLogout()
-	 {
-		if (Application.platform != RuntimePlatform.OSXEditor)   
-		{  
-			luLuLogout(); 
-		}  
-	 }
-     [DllImport("__Internal")]
-    private static extern void luLuBindAccount();
-    //bindAccount
-    public static void txQKBindAccount()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuBindAccount();
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuBindAccountWithType(int type);
-    //bindAccountType
-    public static void txQKBindAccountWithType(int type)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuBindAccountWithType(type);
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuUnbindAccountWithType(int type);
-    //unbindAccountType
-    public static void txQKUnbindAccountWithType(int type)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuUnbindAccountWithType(type);
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuAccountDeletion();
-    //accountDeletion
-    public static void txQKAccountDeletion()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuAccountDeletion();
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuShowMenu(float y);
-    //luLuShowMenu
-    public static void txQKShowMenu(float y)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuShowMenu(y);
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luLuDismissMenu();
-    //luLuDismissMenu
-    public static void txQKDismissMenu()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luLuDismissMenu();
-        }
-    }
-    [DllImport("__Internal")]
-     private static extern void luluSetRoleInfo(string serverName,string serverId,string roleId,string roleName,string roleLevel,string roleVipLevel);
-    //setRoleInfo,参数 游戏服名 游戏服id 角色名 角色id 角色等级 角色vip等级
-    public static void txQKSetRoleInfo(string serverName,string serverId,string roleId,string roleName,string roleLevel,string roleVipLevel)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luluSetRoleInfo(serverName,serverId,roleId,roleName,roleLevel,roleLevel);
-        }
-    }
-	[DllImport("__Internal")]  
-	private static extern void luLuCongzi(string productId,string productName,string amount,string orderNo,string callBackUrl,string extrasParams);
-	//Pay RMB,参数 苹果商品ID 商品名称 价格 游戏订单号 游戏收单服务器地址 透传参数
-	public static void txQKCongzi(string productId,string productName,string amount,string orderNo,string callBackUrl,string extrasParams)
-	{      
-        if (Application.platform != RuntimePlatform.OSXEditor)   
-		{  
-			luLuCongzi(productId,productName,amount,orderNo,callBackUrl,extrasParams);
-		}  
-	}
-    [DllImport("__Internal")]
-    private static extern void luluRestoreNonConsumptionProducts();
-    //lulurestoreNonConsumptionProducts
-    public static void txQKRestoreNonConsumptionProducts()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luluRestoreNonConsumptionProducts();
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern void luluFindProductInfo(string productIds);
-    //luLuDismissMenu
-    public static void txQKFindProductInfo(List<string> goodsIds)
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            luluFindProductInfo(string.Join(",", goodsIds.ToArray()));
-        }
-    }
-    [DllImport("__Internal")]
-    private static extern string LuluGetUserId();
-    public string loginKitGetUserId()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            return LuluGetUserId();
-        }
-        return "";
-    }
-    [DllImport("__Internal")]
-    private static extern string LuluGetDeviceId();
-    public string loginKitGetDeviceId()
-    {
-        if (Application.platform != RuntimePlatform.OSXEditor)
-        {
-            return LuluGetDeviceId();
-        }
-        return "";
-    }
-}
-#endif

+ 5 - 0
Assets/Plugins/Quickscript.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 10fa286097e2b744db33652bf5a4bd00
+folderAsset: yes
+DefaultImporter:
+  userData: 

+ 111 - 0
Assets/Plugins/Quickscript/GameSDKListenter.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace quicksdk
+{
+   public class GameSDKListenter : QuickSDKListener
+    {
+
+        private Action _onExitSuccess;
+        private Action<string> _onFailed;
+        private Action<ErrorMsg> _onInitFailed;
+        private Action _onInitSuccess;
+        private Action<ErrorMsg> _onLoginFailed;
+        private Action<UserInfo> _onLoginSuccess;
+        private Action _onLogoutSuccess;
+
+        private Action<PayResult> _onPayCancel;
+        private Action<PayResult> _onPayFailed;
+        private Action<PayResult> _onPaySuccess;
+
+
+
+        public override void onExitSuccess()
+        {
+            _onExitSuccess?.Invoke();
+        }
+
+        public override void onFailed(string message)
+        {
+            _onFailed?.Invoke(message);
+        }
+
+        public override void onInitFailed(ErrorMsg message)
+        {
+            _onInitFailed?.Invoke(message);
+        }
+
+        public override void onInitSuccess()
+        {
+            _onInitSuccess?.Invoke();
+        }
+
+        public override void onLoginFailed(ErrorMsg errMsg)
+        {
+            _onLoginFailed?.Invoke(errMsg);
+        }
+
+        public override void onLoginSuccess(UserInfo userInfo)
+        {
+            _onLoginSuccess?.Invoke(userInfo);
+        }
+
+        public override void onLogoutSuccess()
+        {
+            _onLogoutSuccess?.Invoke();
+        }
+
+        public override void onPayCancel(PayResult payResult)
+        {
+            _onPayCancel?.Invoke(payResult);
+        }
+
+        public override void onPayFailed(PayResult payResult)
+        {
+            _onPayFailed?.Invoke(payResult);
+        }
+
+        public override void onPaySuccess(PayResult payResult)
+        {
+            _onPaySuccess?.Invoke(payResult);
+        }
+
+        public override void onPrivaceAgree()
+        {
+            
+        }
+
+        public override void onPrivaceRefuse()
+        {
+          
+        }
+
+        public override void onSucceed(string infos)
+        {
+            
+        }
+
+        public override void onSwitchAccountSuccess(UserInfo userInfo)
+        {
+           
+        }
+
+
+
+        public void SetOnExitSuccess    (Action            callback){_onExitSuccess  = callback;}
+        public void SetOnFailed         (Action<string>    callback){_onFailed       = callback;}
+        public void SetOnInitFailed     (Action<ErrorMsg>  callback){_onInitFailed   = callback;}
+        public void SetOnInitSuccess    (Action            callback){_onInitSuccess  = callback;}
+        public void SetOnLoginFailed    (Action<ErrorMsg>  callback){_onLoginFailed  = callback;}
+        public void SetOnLoginSuccess   (Action<UserInfo>  callback){_onLoginSuccess = callback;}
+        public void SetOnLogoutSuccess  (Action            callback){_onLogoutSuccess= callback;}
+        public void SetOnPayCancel      (Action<PayResult> callback){_onPayCancel    = callback;}
+        public void SetOnPayFailed      (Action<PayResult> callback){_onPayFailed    = callback;}
+        public void SetOnPaySuccess     (Action<PayResult> callback){ _onPaySuccess = callback;  }
+
+    }
+}

+ 1 - 1
Assets/Plugins/QuickSDK/QKGame.cs.meta → Assets/Plugins/Quickscript/GameSDKListenter.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 4e5b5d91eed3bc149b9a9aadff0d634a
+guid: 64e428775a3be2b4d9f334342817454f
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 179 - 0
Assets/Plugins/Quickscript/QuickSDK.cs

@@ -0,0 +1,179 @@
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System;
+
+namespace quicksdk
+{
+	public class QuickSDK
+	{
+		private static QuickSDK _instance;
+		
+		public static QuickSDK getInstance() {
+			if( null == _instance ) {
+				_instance = new QuickSDK();
+            }
+			return _instance;
+		}
+
+		public void setListener(QuickSDKListener listener)
+		{
+			QuickSDKImp.getInstance ().setListener (listener);
+        }
+
+		public void reInit()
+		{
+			QuickSDKImp.getInstance().init();
+		}
+
+        public void showPrivace()
+        {
+            QuickSDKImp.getInstance().callShowPrivace();
+        }
+
+        public void init()
+        {
+			QuickSDKImp.getInstance().init();
+		}
+
+		public void exit()
+        {
+			QuickSDKImp.getInstance ().exit();
+        }
+
+		public void login ()
+		{
+			QuickSDKImp.getInstance ().login();
+        }
+		public void logout ()
+		{
+			QuickSDKImp.getInstance ().logout();
+        }
+
+		public void pay (OrderInfo orderInfo, GameRoleInfo gameRoleInfo)
+		{
+			QuickSDKImp.getInstance ().pay(orderInfo, gameRoleInfo);
+        }
+		public string userId()//渠道uid
+		{
+			return QuickSDKImp.getInstance ().userId();            
+		}
+		public string getDeviceId()//设备DeviceId
+		{
+			return QuickSDKImp.getInstance().getDeviceId();
+		}
+		public void createRole(GameRoleInfo gameRoleInfo){
+			QuickSDKImp.getInstance ().createRole (gameRoleInfo);//创建角色
+		}
+		public void enterGame(GameRoleInfo gameRoleInfo){
+			QuickSDKImp.getInstance ().enterGame (gameRoleInfo);//开始游戏
+		}
+		public void updateRole(GameRoleInfo gameRoleInfo){
+			QuickSDKImp.getInstance ().updateRole (gameRoleInfo);//角色升级
+		}
+
+
+
+		public void enterYunKeFuCenter(GameRoleInfo gameRoleInfo){
+			QuickSDKImp.getInstance ().enterYunKeFuCenter (gameRoleInfo);//进入云客服
+		}
+		public void callSDKShare(ShareInfo shareInfo){
+			QuickSDKImp.getInstance ().callSDKShare(shareInfo);//进入云客服
+		}
+
+
+
+
+		public String showToolBar(ToolbarPlace place)//1左上,2右上,3左中,4右中,5左下,6右下
+		{
+			return QuickSDKImp.getInstance ().showToolBar (place);
+		}
+		public String hideToolBar()
+		{
+			return QuickSDKImp.getInstance ().hideToolBar ();
+		}
+		public bool isFunctionSupported(FuncType type)
+		{
+			return QuickSDKImp.getInstance ().isFunctionSupported (type);
+		}
+		public String callFunction(FuncType type)
+		{
+			return QuickSDKImp.getInstance ().callFunction (type);
+		}
+
+        public String callFunctionWithResult(FuncType type)
+        {
+            return QuickSDKImp.getInstance().callFuncWithResult(type);
+        }
+        public string channelName()          //获取渠道名称
+		{
+			return QuickSDKImp.getInstance ().channelName ();
+		}
+		public string channelVersion()       //获取渠道版本
+		{
+			return QuickSDKImp.getInstance ().channelVersion ();   
+		}
+		public int channelType()                 //获取渠道类别 渠道唯一标识
+		{
+			return QuickSDKImp.getInstance ().channelType ();
+		}
+		public string SDKVersion()      //QuickSDK版本
+		{
+			return QuickSDKImp.getInstance ().SDKVersion ();   
+		}
+
+		public string getConfigValue(string key)
+		{
+			return QuickSDKImp.getInstance ().getConfigValue (key);
+		}
+
+        public void exitGame()
+        {
+            QuickSDKImp.getInstance().exitGame();
+        }
+
+        public bool isChannelHasExitDialog()
+        {
+            return QuickSDKImp.getInstance().isChannelHasExitDialog();
+        }
+
+		//以下是v1.1的老接口,新接入用不到
+		public void updateRoleInfoWith(GameRoleInfo gameRoleInfo, bool isCreateRole)
+		{
+			QuickSDKImp.getInstance ().updateRoleInfoWith (gameRoleInfo, isCreateRole);
+		}
+
+		public String enterUserCenter() //用户中心
+		{
+			return QuickSDKImp.getInstance ().enterUserCenter ();
+		}
+
+
+		public String openFloatUserCenter() //用户中心
+		{
+			return QuickSDKImp.getInstance().openFloatUserCenter();
+		}
+
+		public String getOaid()
+        {
+            return QuickSDKImp.getInstance().getOaid();
+        }
+
+        public String getParentChannelType()
+        {
+            return QuickSDKImp.getInstance().getParentChannelType();
+        }
+
+		public int callFuncTypeWithParams(int funcType,String[] param)
+        {
+			return QuickSDKImp.getInstance().callFunctionWithParams(funcType, param);
+        }
+
+
+
+
+
+
+    }
+}

+ 1 - 1
Assets/Plugins/QuickSDK/LoginKitListener.cs.meta → Assets/Plugins/Quickscript/QuickSDK.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: c296c31b16d49b542a8b7b0990e4a616
+guid: 6a803e0a1e5914401bee0c473eadb9cc
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 890 - 0
Assets/Plugins/Quickscript/QuickSDKImp.cs

@@ -0,0 +1,890 @@
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System;
+
+namespace quicksdk
+{
+	public class OrderInfo{
+		public string goodsID;
+		public string goodsName;
+		public string goodsDesc;
+		public string quantifier; //商品量词
+		public string cpOrderID;
+		public string callbackUrl;
+		public string extrasParams;
+		public double price;
+		public double amount;
+		public int count;
+	}
+	
+	public class GameRoleInfo
+	{
+		public string serverName;
+		public string serverID;
+		public string gameRoleName;
+		public string gameRoleID;
+		public string gameRoleBalance;
+		public string vipLevel;
+		public string gameRoleLevel;
+		public string partyName;
+        public string roleCreateTime;
+		public string profession;
+		public string gameRoleGender;
+		public string gameRolePower;
+		public string partyId;
+
+		public String professionId;
+		public String partyRoleId;
+		public String partyRoleName;
+		public String friendlist;
+	}
+	public class ShareInfo
+	{
+		public String title;   //分享标题
+		public String content;   //分享内容
+		public String imgPath;   //分享图片本地地址
+		public String imgUrl;   //分享图片网络地址
+		public String url;   //分享链接
+		public String type;   //分享类型
+		public String shareTo;   //分享到哪里
+		public String extenal;   //额外备注
+	}
+	
+	public enum FuncType 
+	{
+		
+		QUICK_SDK_FUNC_TYPE_UNDEFINED = 0,
+		QUICK_SDK_FUNC_TYPE_ENTER_BBS = 101,/*进入论坛*/
+		QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER = 102,/*进入用户中心*/
+		QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR = 103,/*显示浮动工具栏*/
+		QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR = 104,/*隐藏浮动工具栏*/
+		QUICK_SDK_FUNC_TYPE_REAL_NAME_REGISTER = 105,/*实名认证*/
+		QUICK_SDK_FUNC_TYPE_ANTI_ADDICTION_QUERY = 106, /*防沉迷 (android)*/
+		QUICK_SDK_FUNC_TYPE_PAUSED_GAME,/*暂停游戏 (iOS)*/
+		QUICK_SDK_FUNC_TYPE_ENTER_CUSTOMER_CENTER,		/*进入客服中心*/
+        QUICK_SDK_FUNC_TYPE_QUERY_GOODS_INFO,
+		QUICK_SDK_FUNC_TYPE_GET_DEVICE_ID = 112 ,    /*获取DeviceID*/
+		QUICK_SDK_FUNC_TYPE_OPEN_FLOAT_CENTER = 209     /*打开浮球的用户中心*/
+	}
+
+	public enum ToolbarPlace
+	{
+		QUICK_SDK_TOOLBAR_TOP_LEFT  = 1,           /* 左上 */
+		QUICK_SDK_TOOLBAR_TOP_RIGHT = 2,           /* 右上 */
+		QUICK_SDK_TOOLBAR_MID_LEFT  = 3,           /* 左中 */
+		QUICK_SDK_TOOLBAR_MID_RIGHT = 4,           /* 右中 */
+		QUICK_SDK_TOOLBAR_BOT_LEFT  = 5,           /* 左下 */
+		QUICK_SDK_TOOLBAR_BOT_RIGHT = 6            /* 右下 */
+	}
+	
+	// 错误信息
+	public class ErrorMsg
+	{
+		public string errMsg;
+	}
+	
+	// 用户信息,登录回调中使用
+	public class UserInfo : ErrorMsg
+	{
+		public string uid;
+		public string userName;
+		public string token;
+	}
+	
+	// 支付信息,支付回调中使用
+	public class PayResult
+	{
+		public string orderId;
+		public string cpOrderId;
+		public string extraParam;
+	}
+	
+	public class QuickSDKImp
+	{
+		private static QuickSDKImp _instance;
+		
+		public static QuickSDKImp getInstance() {
+			if( null == _instance ) {
+				_instance = new QuickSDKImp();
+			}
+			return _instance;
+		}
+		
+		public void setListener(QuickSDKListener listener)
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			string gameObjectName = listener.gameObject.name;
+			quicksdk_nativeSetListener(gameObjectName);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.setListener(listener);
+#endif
+		}
+
+        public void callShowPrivace()
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+
+#elif UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            androidSupport.showPrivace();
+#endif
+        }
+
+        public void init()
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+
+#elif UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            androidSupport.init();
+#endif
+        }
+
+		
+		public void exit()
+		{
+#if UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.exit();
+#endif
+		}
+		
+		public void login ()
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			quicksdk_nativeLogin();
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.login();
+#endif
+		}
+		public void logout ()
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			quicksdk_nativeLogout();
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.logout();
+#endif
+		}
+		
+		public void pay (OrderInfo orderInfo, GameRoleInfo gameRoleInfo)
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			quicksdk_nativePay(orderInfo.goodsID, orderInfo.goodsName, orderInfo.goodsDesc, orderInfo.quantifier, orderInfo.cpOrderID, orderInfo.callbackUrl, orderInfo.extrasParams, orderInfo.price, orderInfo.amount, orderInfo.count,
+			                   gameRoleInfo.serverID, gameRoleInfo.serverName, gameRoleInfo.gameRoleName, gameRoleInfo.gameRoleID, gameRoleInfo.gameRoleBalance, gameRoleInfo.vipLevel, gameRoleInfo.gameRoleLevel, gameRoleInfo.partyName, gameRoleInfo.gameRolePower, gameRoleInfo.profession);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.pay(orderInfo, gameRoleInfo);
+#endif
+		}
+		public string userId()//uid
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			IntPtr intPtr = quicksdk_nativeUserId();
+			return Marshal.PtrToStringAnsi(intPtr);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getUserId();
+#else
+			return "";
+#endif
+			
+		}
+		public string getDeviceId()//getDeviceId
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			return "";
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getDeviceId();
+#else
+			return "";
+#endif
+
+		}
+		public void createRole(GameRoleInfo gameRoleInfo){
+			updateRoleInfoWith (gameRoleInfo, true);
+		}
+
+		public void enterGame(GameRoleInfo gameRoleInfo){
+			updateRoleInfoWith (gameRoleInfo, false);
+		}
+
+		public void updateRole(GameRoleInfo gameRoleInfo){
+			updateRoleInfoWith (gameRoleInfo, false);
+		}
+
+		public String showToolBar(ToolbarPlace place)//1左上,2右上,3左中,4右中,5左下,6右下
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			return (quicksdk_nativeShowToolBar((int)place) == -100?"0":"1");
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(FuncType.QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR);
+			#else
+			return "0";
+			#endif
+			
+		}
+		public String hideToolBar()
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			return (quicksdk_nativeHideToolBar() == -100?"0":"1");
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(FuncType.QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR);
+			#else
+			return "0";
+			#endif
+			
+		}
+
+		public bool isFunctionSupported(FuncType type)//1暂停游戏,2进入用户中心,3进入论坛,4处理应用跳转(旧),5显示浮动工具栏,6隐藏浮动工具栏,7处理应用跳转(新),8实名认证
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			switch (type) {
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_BBS:
+				return quicksdk_nativeIsFunctionTypeSupported(3);
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER:
+				return quicksdk_nativeIsFunctionTypeSupported(2);
+			case FuncType.QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR:
+				return quicksdk_nativeIsFunctionTypeSupported(5);
+			case FuncType.QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR:
+				return quicksdk_nativeIsFunctionTypeSupported(6);
+			case FuncType.QUICK_SDK_FUNC_TYPE_PAUSED_GAME:
+				return quicksdk_nativeIsFunctionTypeSupported(1);
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_CUSTOMER_CENTER:
+				return quicksdk_nativeIsFunctionTypeSupported(7);
+			case FuncType.QUICK_SDK_FUNC_TYPE_REAL_NAME_REGISTER:
+				return quicksdk_nativeIsFunctionTypeSupported(8);
+			default:
+				return false;
+			}
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.isFuncSupport(type);
+#else
+			return false;
+#endif
+			
+		}
+
+        public String callFunction(FuncType type)
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+			switch (type) {
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_BBS:
+				quicksdk_nativeEnterBBS();
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER:
+				quicksdk_nativeEnterUserCenter();
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR:
+				quicksdk_nativeShowToolBar(3);
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR:
+				quicksdk_nativeHideToolBar();
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_PAUSED_GAME:
+				quicksdk_nativePausedGame();
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_CUSTOMER_CENTER:
+				quicksdk_nativeEnterCustomerCenter();
+				return "";
+			case FuncType.QUICK_SDK_FUNC_TYPE_REAL_NAME_REGISTER:
+				quicksdk_nativeRealNameAuth(1);
+				return "";
+			default:
+				return "";
+			}
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(type)+"";
+#else
+            return "";
+#endif
+        }
+
+     
+
+        public String callFuncWithResult(FuncType type)
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+            return "";
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFuncWithResult(type);
+#else
+            return "";
+#endif
+        }
+
+
+        public string channelName()          //获取渠道名称
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			IntPtr intPtr = quicksdk_nativeChannelName();
+			return Marshal.PtrToStringAnsi(intPtr);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getChannelName();
+#else 
+			return "";
+#endif
+			
+		}
+		public string channelVersion()       //获取渠道版本
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			IntPtr intPtr = quicksdk_nativeChannelVersion();
+			return Marshal.PtrToStringAnsi(intPtr);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getChannelVersion();
+#else
+			return "";
+#endif
+			
+		}
+
+        public String getParentChannelType()
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+            return "";
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getParentChannelType();
+#else
+            return "";
+#endif
+        }
+
+
+        public String getOaid()
+        {
+#if UNITY_IOS && !UNITY_EDITOR
+        		return "";
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getOaid();
+#else
+            return "";
+#endif
+        }
+        public int channelType()                 //获取渠道类别 渠道唯一标识
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			return quicksdk_nativeChannelType();
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getChannelType();
+#else
+			return 0;
+#endif
+			
+		}
+		public string SDKVersion()      //QuickSDK版本
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			IntPtr intPtr = quicksdk_nativeSDKVersion();
+			return Marshal.PtrToStringAnsi(intPtr);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.getSDKVersion();
+#else
+			return "";
+#endif
+			
+		}
+
+		public string getConfigValue(string key)      //QuickSDK版本
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			IntPtr intPtr = quicksdk_nativeGetConfigValue(key);
+			return Marshal.PtrToStringAnsi(intPtr);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            return androidSupport.getConfigValue(key);
+#else
+            return "";
+#endif
+			
+		}
+
+
+		//返回为0代表不支持该funcType,返回1则代表支持
+		public int callFunctionWithParams(int funcType,String[] param)      
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			return 0;
+#elif UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            return androidSupport.callFunctionWithParams(funcType,param);
+#else
+			return 0;
+#endif
+
+		}
+
+		
+
+
+		public bool isChannelHasExitDialog()
+        {
+#if UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            return androidSupport.isChannelHasExitDialog();
+#else
+            return false;
+#endif
+        }
+
+        public void exitGame()
+        {
+#if UNITY_ANDROID && !UNITY_EDITOR
+            QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+            androidSupport.exitGame();
+#endif
+
+        }
+
+
+		public String openFloatUserCenter() //打开浮球的用户中心
+		{
+#if UNITY_IOS && !UNITY_EDITOR
+			return "0";
+#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(FuncType.QUICK_SDK_FUNC_TYPE_OPEN_FLOAT_CENTER);
+#else
+			return "0";
+#endif
+
+		}
+
+
+
+
+		public void updateRoleInfoWith(GameRoleInfo gameRoleInfo, bool isCreateRole)
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			quicksdk_nativeUpdateRoleInfo(gameRoleInfo.serverID, gameRoleInfo.serverName, gameRoleInfo.gameRoleName, gameRoleInfo.gameRoleID, gameRoleInfo.gameRoleBalance, gameRoleInfo.vipLevel, gameRoleInfo.gameRoleLevel, gameRoleInfo.partyName, gameRoleInfo.roleCreateTime, gameRoleInfo.gameRolePower, gameRoleInfo.profession, isCreateRole);
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.updateRoleInfo(gameRoleInfo, isCreateRole);
+			#endif
+		}
+		public String enterUserCenter() //用户中心
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			return (quicksdk_nativeEnterUserCenter() == -100?"0":"1"
+            );
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(FuncType.QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER);
+			#else
+			return "0";
+			#endif
+			
+		}
+
+		public void enterYunKeFuCenter(GameRoleInfo gameRoleInfo){
+			#if UNITY_IOS && !UNITY_EDITOR
+			quicksdk_nativeEnterYunKeFuCenter(gameRoleInfo.gameRoleID, gameRoleInfo.gameRoleName, gameRoleInfo.serverName, gameRoleInfo.vipLevel);
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.callCustomPlugin(gameRoleInfo.gameRoleID, gameRoleInfo.gameRoleName, gameRoleInfo.serverName, gameRoleInfo.vipLevel);
+			#endif
+		}
+		public void callSDKShare(ShareInfo shareInfo){
+			#if UNITY_IOS && !UNITY_EDITOR
+
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			androidSupport.callSDKShare(shareInfo.title, shareInfo.content, shareInfo.imgPath, shareInfo.imgUrl,shareInfo.url,shareInfo.type,shareInfo.shareTo,shareInfo.extenal);
+			#endif
+		}
+		
+		private int enterCustomerCenter() ////客服
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			return (quicksdk_nativeEnterCustomerCenter() == -100?0:1);
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			return 0;
+			#else
+			return 0;
+			#endif
+			
+		}
+		private String enterBBS()//BBS
+		{
+			#if UNITY_IOS && !UNITY_EDITOR
+			return (quicksdk_nativeEnterBBS() == -100?"0":"1");
+			#elif UNITY_ANDROID && !UNITY_EDITOR
+			QuickUnitySupportAndroid androidSupport = QuickUnitySupportAndroid.getInstance();
+			return androidSupport.callFunc(FuncType.QUICK_SDK_FUNC_TYPE_ENTER_BBS);
+			#else
+			return "0";
+			#endif
+			
+		}
+		
+		#if UNITY_IOS && !UNITY_EDITOR
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeSetListener(string gameObjectName);
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeLogin();
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeLogout();
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeRealNameAuth(int show);
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativePay(string goodsId, string goodsName, string goodsDesc, string quantifier, string cpOrderId, string callbackUrl, string extrasParams, double price, double amount, int count,
+		                                              string serverId, string serverName, string gameRoleName, string gameRoleId, string gameRoleBalance, string vipLevel, string gameRoleLevel, string partyName, string fightPower, string profession);
+		[DllImport("__Internal")]
+		private static extern IntPtr quicksdk_nativeUserId();
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeUpdateRoleInfo(string serverId, string serverName, string gameRoleName, string gameRoleId, string gameRoleBalance, string vipLevel, string gameRoleLevel, string partyName, string roleCreateTime, string fightPower, string profession, bool isCreate);
+		[DllImport("__Internal")]
+		private static extern void quicksdk_nativeEnterYunKeFuCenter(string gameRoleID, string gameRoleName, string serverName, string vipLevel);
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativeEnterUserCenter();
+		[DllImport("__Internal")]
+        private static extern int quicksdk_nativeEnterCustomerCenter();
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativeEnterBBS();
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativeShowToolBar(int place);
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativeHideToolBar();
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativePausedGame();
+		[DllImport("__Internal")]
+		private static extern bool quicksdk_nativeIsFunctionTypeSupported(int type);
+		[DllImport("__Internal")]
+		private static extern IntPtr quicksdk_nativeChannelName();
+		[DllImport("__Internal")]
+		private static extern IntPtr quicksdk_nativeChannelVersion();
+		[DllImport("__Internal")]
+		private static extern int quicksdk_nativeChannelType();
+		[DllImport("__Internal")]
+		private static extern IntPtr quicksdk_nativeSDKVersion();
+		[DllImport("__Internal")]
+		private static extern IntPtr quicksdk_nativeGetConfigValue(string key);
+		#endif
+
+    }
+
+#if UNITY_ANDROID && !UNITY_EDITOR
+
+    public class QuickUnitySupportAndroid {
+
+        AndroidJavaObject ao;
+
+        private static QuickUnitySupportAndroid instance;
+
+        private QuickUnitySupportAndroid() {
+            
+            AndroidJavaClass ac = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
+            ao = ac.GetStatic<AndroidJavaObject>("currentActivity");
+        }
+
+        public static QuickUnitySupportAndroid getInstance()
+        {
+            if (instance == null)
+            {
+                instance = new QuickUnitySupportAndroid();
+            }
+
+            return instance;
+        }
+
+		public void setListener(QuickSDKListener listener)
+        {
+            Debug.Log("gameObject is " + listener.gameObject.name);
+            if (listener == null)
+            {
+                Debug.LogError("set QuickSDKListener error, listener is null");
+                return;
+            }
+            string gameObjectName = listener.gameObject.name;
+            if (ao == null)
+            {
+                Debug.LogError("setListener error, current activity is null");
+            }
+            else
+            {
+                ao.Call("setUnityGameObjectName", gameObjectName);
+            }
+        }
+
+        public void init()
+        {
+			ao.Call("requestInit");
+        }
+
+        public void showPrivace()
+        {
+			ao.Call("showPrivace");
+        }
+
+        public void exit()
+        {
+            ao.Call("requestExit");
+        }
+
+        public void login()
+        {
+            ao.Call("requestLogin");
+        }
+
+        public void logout()
+        {
+            ao.Call("requestLogout");
+        }
+
+		public void callCustomPlugin(String roleId,String roleName,String serverName,String vip)
+		{
+			ao.Call("requestCallCustomPlugin",roleId,roleName,serverName,vip);
+		}
+		public void callSDKShare(String title,String content,String imgPath,String imgUrl,String url,String type,String shareTo,String extenal)
+		{
+			ao.Call("requestCallSDKShare",title,content,imgPath,imgUrl,url,type,shareTo,extenal);
+		}
+
+
+        public void pay(OrderInfo orderInfo, GameRoleInfo gameRoleInfo)
+        {
+            if (orderInfo == null)
+            {
+                Debug.LogError("call pay error, orderInfo is null");
+                return;
+            }
+            ao.Call("requestPay",
+                orderInfo.goodsID, orderInfo.goodsName, 
+                orderInfo.goodsDesc, orderInfo.quantifier, 
+                orderInfo.cpOrderID, orderInfo.callbackUrl, 
+                orderInfo.extrasParams, orderInfo.price+"", 
+                orderInfo.amount + "", orderInfo.count+"",
+                
+                gameRoleInfo.serverName, gameRoleInfo.serverID,
+                gameRoleInfo.gameRoleName, gameRoleInfo.gameRoleID,
+                gameRoleInfo.gameRoleBalance, gameRoleInfo.vipLevel,
+                gameRoleInfo.gameRoleLevel, gameRoleInfo.partyName, gameRoleInfo.roleCreateTime);
+        }
+
+        public string getUserId()
+        {
+            return ao.Call<string>("getUserId");
+        }
+
+	     public string getDeviceId()
+        {
+			return ao.Call<string>("getDeviceID");
+        }
+
+        public void updateRoleInfo(GameRoleInfo gameRoleInfo, bool isCreate)
+        {
+            if (gameRoleInfo.Equals(null))
+            {
+                Debug.LogError("updateRoleInfo is error, gameRoleInfo is null");
+                return;
+            }
+
+            string serverName = String.IsNullOrEmpty(gameRoleInfo.serverName) ? "" : gameRoleInfo.serverName;
+            string serverId = String.IsNullOrEmpty(gameRoleInfo.serverID) ? "" : gameRoleInfo.serverID;
+            string roleName = String.IsNullOrEmpty(gameRoleInfo.gameRoleName) ? "" : gameRoleInfo.gameRoleName;
+            string roleId = String.IsNullOrEmpty(gameRoleInfo.gameRoleID) ? "" : gameRoleInfo.gameRoleID;
+            string roleBalance = String.IsNullOrEmpty(gameRoleInfo.gameRoleBalance) ? "" : gameRoleInfo.gameRoleBalance;
+            string vipLevel = String.IsNullOrEmpty(gameRoleInfo.vipLevel) ? "" : gameRoleInfo.vipLevel;
+            string roleLevel = String.IsNullOrEmpty(gameRoleInfo.gameRoleLevel) ? "" : gameRoleInfo.gameRoleLevel;
+            string partyName = String.IsNullOrEmpty(gameRoleInfo.partyName) ? "" : gameRoleInfo.partyName;
+            string roleCreateTime = String.IsNullOrEmpty(gameRoleInfo.roleCreateTime) ? "" : gameRoleInfo.roleCreateTime;
+			string gameRoleGender = String.IsNullOrEmpty(gameRoleInfo.gameRoleGender) ? "" : gameRoleInfo.gameRoleGender;
+			string gameRolePower = String.IsNullOrEmpty(gameRoleInfo.gameRolePower) ? "" : gameRoleInfo.gameRolePower;
+			string partyId = String.IsNullOrEmpty(gameRoleInfo.partyId) ? "" : gameRoleInfo.partyId;
+
+			string professionId = String.IsNullOrEmpty(gameRoleInfo.professionId) ? "" : gameRoleInfo.professionId;
+			string profession = String.IsNullOrEmpty(gameRoleInfo.profession) ? "" : gameRoleInfo.profession;
+			string partyRoleId = String.IsNullOrEmpty(gameRoleInfo.partyRoleId) ? "" : gameRoleInfo.partyRoleId;
+			string partyRoleName = String.IsNullOrEmpty(gameRoleInfo.partyRoleName) ? "" : gameRoleInfo.partyRoleName;
+			string friendlist = String.IsNullOrEmpty(gameRoleInfo.friendlist) ? "" : gameRoleInfo.friendlist;
+
+
+            ao.Call("requestUpdateRole",
+                serverId,
+                serverName,
+                roleName,
+                roleId,
+                roleBalance,
+                vipLevel,
+                roleLevel,
+                partyName,
+			    roleCreateTime,
+                gameRoleGender,
+			    gameRolePower,
+			    partyId,
+			    professionId,
+			    profession,
+			    partyRoleId,
+			    partyRoleName,
+			    friendlist,
+                isCreate + "");
+            Debug.LogWarning("updateRoleInfo executed");
+        }
+
+        /**
+         * return 0 success, -100 false or not support such function
+         */
+        public String callFunc(FuncType funcType)
+        {
+            int androidFuncType = 0;
+            switch (funcType)
+            {
+                case FuncType.QUICK_SDK_FUNC_TYPE_UNDEFINED:
+                    // Do nothing
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_BBS:
+                    androidFuncType = 101;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER:
+                    androidFuncType = 102;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR:
+                    androidFuncType = 103;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR:
+                    androidFuncType = 104;
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_REAL_NAME_REGISTER:
+                    androidFuncType = 105;
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_ANTI_ADDICTION_QUERY:
+                    androidFuncType = 106;
+                    break;
+				case FuncType.QUICK_SDK_FUNC_TYPE_OPEN_FLOAT_CENTER:
+                    androidFuncType = 209;
+                    break;
+					
+            }
+
+            // TODO
+            return ao.Call<String>("callFunc", androidFuncType);
+        }
+       public String callFunc(FuncType funcType,string s)
+        {
+			int androidFuncType =(int) funcType;
+
+            // TODO
+			return ao.Call<String>("callFunc", androidFuncType,s);
+        }
+
+        public String callFuncWithResult(FuncType funcType)
+        {
+			int androidFuncType =(int) funcType;
+
+            // TODO
+			return ao.Call<String>("callFuncWithResult", androidFuncType);
+        }
+
+        public bool isFuncSupport(FuncType funcType)
+        {
+            int androidFuncType = 0;
+            switch (funcType)
+            {
+                case FuncType.QUICK_SDK_FUNC_TYPE_UNDEFINED:
+                    // Do nothing
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_BBS:
+                    androidFuncType = 101;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER:
+                    androidFuncType = 102;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR:
+                    androidFuncType = 103;
+                    break;
+
+                case FuncType.QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR:
+                    androidFuncType = 104;
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_REAL_NAME_REGISTER:
+                    androidFuncType = 105;
+                    break;
+                case FuncType.QUICK_SDK_FUNC_TYPE_ANTI_ADDICTION_QUERY:
+                    androidFuncType = 106;
+                    break;
+            }
+            return ao.Call<bool>("isFuncSupport", androidFuncType);
+        }
+
+        public string getChannelName()
+        {
+            return ao.Call<string>("getChannelName");
+        }
+
+        public string getChannelVersion()
+        {
+            return ao.Call<string>("getChannelVersion");
+        }
+
+        public string getOaid()
+        {
+            return ao.Call<string>("getOaid");
+        }
+
+        public int getChannelType()
+        {
+            return ao.Call<int>("getChannelType");
+        }
+
+        public string getSDKVersion()
+        {
+            return ao.Call<string>("getSDKVersion");
+        }
+
+        public string getParentChannelType()
+        {
+            return ao.Call<string>("getParentChannelType");
+        }
+
+        public string getConfigValue(string key)
+        {
+            if (String.IsNullOrEmpty(key))
+            {
+                return null;
+            }
+            return ao.Call<string>("getConfigValue", key);
+        }
+
+        public bool isChannelHasExitDialog()
+        {
+            return ao.Call<bool>("isChannelHasExitDialog");
+        }
+
+        public void exitGame()
+        {
+            ao.Call("exitGame");
+        }
+
+		 public int callFunctionWithParams(int funcType, String[] param)
+        {
+            return ao.Call<int>("callFunctionWithParams",funcType,param);
+        }
+
+
+
+
+}
+#endif
+}
+

+ 1 - 1
Assets/Plugins/QuickSDK/SimpleJSON.cs.meta → Assets/Plugins/Quickscript/QuickSDKImp.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e0519c84a5b59d144a0279067a8e0dff
+guid: 3f01546441d2c4674adf5db72fd09272
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 3 - 3
Assets/Plugins/QuickSDK/SimpleJSON.cs → Assets/Plugins/Quickscript/QuickSDKJSON.cs

@@ -1,4 +1,4 @@
-//#define USE_SharpZipLib
+//#define USE_SharpZipLib
 #if !UNITY_WEBPLAYER
 #define USE_FileIO
 #endif
@@ -47,7 +47,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
-namespace quickgame
+namespace quicksdk
 {
 	namespace SimpleJSON
 	{
@@ -1018,4 +1018,4 @@ namespace quickgame
 			}
 		}
 	}
-}
+}

+ 11 - 0
Assets/Plugins/Quickscript/QuickSDKJSON.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 66dde44a008a84db794444a566f159db
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 156 - 0
Assets/Plugins/Quickscript/QuickSDKListener.cs

@@ -0,0 +1,156 @@
+using UnityEngine;
+using System.Collections;
+
+namespace quicksdk
+{
+    // QuickSDKListener
+    public abstract class QuickSDKListener : MonoBehaviour
+    {
+        //callback
+		public abstract void onInitSuccess();
+
+		public abstract void onInitFailed(ErrorMsg message);
+
+        public abstract void onLoginSuccess(UserInfo userInfo);
+
+		public abstract void onSwitchAccountSuccess(UserInfo userInfo);
+
+		public abstract void onLoginFailed(ErrorMsg errMsg);
+
+        public abstract void onLogoutSuccess();
+
+        public abstract void onSucceed(string infos);
+        public abstract void onFailed(string message);
+
+
+
+        public abstract void onPaySuccess(PayResult payResult);
+
+        public abstract void onPayFailed(PayResult payResult);
+
+        public abstract void onPayCancel(PayResult payResult);
+
+        public abstract void onExitSuccess();
+
+        public abstract void onPrivaceAgree();
+        public abstract void onPrivaceRefuse();
+
+
+        //callback end
+
+
+        public void onInitSuccess(string msg)
+		{
+            Debug.Log("QuickSdkListener  onInitSuccess");
+            onInitSuccess();
+		}
+
+		public void onInitFailed(string msg)
+		{
+			var data = SimpleJSON.JSONNode.Parse(msg);
+			ErrorMsg errMsg = new ErrorMsg();
+			errMsg.errMsg =  data["msg"].Value;
+			
+			onInitFailed(errMsg);
+		}
+
+        public void onLoginSuccess(string msg)
+        {
+            var data = SimpleJSON.JSONNode.Parse(msg);
+            UserInfo userInfo = new UserInfo();
+            userInfo.uid = data["userId"].Value;
+            userInfo.token = data["userToken"].Value;
+            userInfo.userName = data["userName"].Value;
+            userInfo.errMsg = data["msg"].Value;
+
+            onLoginSuccess(userInfo);
+        }
+
+		public void onSwitchAccountSuccess(string msg)
+		{
+			var data = SimpleJSON.JSONNode.Parse(msg);
+			UserInfo userInfo = new UserInfo();
+			userInfo.uid = data["userId"].Value;
+			userInfo.token = data["userToken"].Value;
+			userInfo.userName = data["userName"].Value;
+			userInfo.errMsg = data["msg"].Value;
+
+			onSwitchAccountSuccess(userInfo);
+		}
+
+        public void onLoginFailed(string msg)
+        {
+            var data = SimpleJSON.JSONNode.Parse(msg);
+			ErrorMsg errMsg = new ErrorMsg();
+			errMsg.errMsg = data["msg"].Value;
+			
+			onLoginFailed(errMsg);
+        }
+
+        public void onLogoutSuccess(string msg)
+        {
+            onLogoutSuccess();
+        }
+
+
+
+        public void onPaySuccess(string msg)
+        {
+            var data = SimpleJSON.JSONNode.Parse(msg);
+            PayResult result = new PayResult();
+            result.cpOrderId = data["cpOrderId"].Value;
+            result.orderId = data["orderId"].Value;
+            result.extraParam = data["extraParam"].Value;
+
+            onPaySuccess(result);
+        }
+
+        public void onPayFailed(string msg)
+        {
+            var data = SimpleJSON.JSONNode.Parse(msg);
+            PayResult result = new PayResult();
+            result.cpOrderId = data["cpOrderId"].Value;
+            result.orderId = data["orderId"].Value;
+            result.extraParam = data["extraParam"].Value;
+
+            onPayFailed(result);
+        }
+
+        public void onPayCancel(string msg)
+        {
+            var data = SimpleJSON.JSONNode.Parse(msg);
+            PayResult result = new PayResult();
+            result.cpOrderId = data["cpOrderId"].Value;
+            result.orderId = data["orderId"].Value;
+            result.extraParam = data["extraParam"].Value;
+
+            onPayCancel(result);
+        }
+
+        public void onExitSuccess(string msg)
+        {
+            Debug.Log("QuickSdkListener  onExitSuccess");
+            onExitSuccess();
+        }
+		
+        public void onSuccess(string infos)
+        {
+            onSucceed(infos);
+        }
+
+        public void onFail(string msg)
+        {
+            onFailed(msg);
+        }
+
+        public void onPrivaceAgree(string msg)
+        {
+            onPrivaceAgree();
+        }
+        public void onPrivaceRefuse(string msg)
+        {
+            onPrivaceRefuse();
+        }
+
+    }
+}

+ 11 - 0
Assets/Plugins/Quickscript/QuickSDKListener.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8993f23a5c499aa40bd5e272c47f1dc4
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 0
Assets/Src/GameLogic/LaunchLoadMgr.cs

@@ -154,6 +154,9 @@ public class LaunchLoadMgr
                     float tsize = DownloadMgr.Instance.TotalSize;
                     float press = (dsize / tsize) * 100;
                     SetLoadPrecent((int)press);
+                    string tstr = (tsize / (1024 * 1024)).ToString("f2");
+                    string dstr = (dsize / (1024 * 1024)).ToString("f2");
+                    SetLoadDes($"資源更新:{dsize}m/{tstr}m");
                 }
 
                 return isFinish;

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -245,7 +245,7 @@ PlayerSettings:
   clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
   templatePackageId: com.unity.template.3d@1.3.0
   templateDefaultScene: Assets/Scenes/SampleScene.unity
-  useCustomMainManifest: 0
+  useCustomMainManifest: 1
   useCustomLauncherManifest: 0
   useCustomMainGradleTemplate: 0
   useCustomLauncherGradleManifest: 0
@@ -846,7 +846,7 @@ PlayerSettings:
   webGLDecompressionFallback: 1
   webGLPowerPreference: 1
   scriptingDefineSymbols:
-    Android: USE_LUA;VUPLEX_CCU;BUGLY;FPS_DISABLE;GAME_DEBUG
+    Android: USE_LUA;VUPLEX_CCU;BUGLY;FPS_DISABLE;GAME_DEBUG;GAME_ONE
     Standalone: USE_LUA;VUPLEX_CCU
     WebGL: USE_LUA;VUPLEX_CCU
     iPhone: USE_LUA;VUPLEX_CCU

+ 2 - 2
ProtocolGen/proto/login.proto

@@ -2774,9 +2774,9 @@ message CSPayInfoGetReq {   //project game  //RouteRule game
 }
 message SCPayInfoGetAck {
     int32 error                                         = 1; //错误码
-    int32 goods_id                                      = 2;
+    int32 goods_id                                      = 2;//
     int32 goods_type                                    = 3;
-    string goods_name                                   = 4;
+    string goods_name                                   = 4; //Name|callackUr
     uint64 cp_order_id                                  = 5; //产品订单号
     float amount                                        = 6; //支付总额
     int32 count                                         = 7; //购买数量