From 7e2df20ccc7cdfb528d309369460a4f3d66afdf1 Mon Sep 17 00:00:00 2001
From: liuxue <q3213421wrwqr>
Date: 星期四, 29 七月 2021 17:51:09 +0800
Subject: [PATCH] 0000 增加bt3 quick android 和 ios 的 SDK

---
 SdkProject/library/src/main/java/com/secondworld/sdk/UnityMsgHandler.java |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/SdkProject/library/src/main/java/com/secondworld/sdk/UnityMsgHandler.java b/SdkProject/library/src/main/java/com/secondworld/sdk/UnityMsgHandler.java
index a94868b..c0cdbe8 100644
--- a/SdkProject/library/src/main/java/com/secondworld/sdk/UnityMsgHandler.java
+++ b/SdkProject/library/src/main/java/com/secondworld/sdk/UnityMsgHandler.java
@@ -58,7 +58,7 @@
             int code = _json.getInt("code");
             ICommand command = allCommand.get(code);
             if (command == null)
-                LogUtil.w("onUnityMessage", "鏈煡鍛戒护" + code);
+                LogUtil.e("onUnityMessage", "鏈煡鍛戒护" + code);
             else
                 command.process(_json);
         } catch (Exception e) {
@@ -74,7 +74,7 @@
      */
     public static List<String> getClassName(String packageName) throws IOException {
         List<String> classNameList = new ArrayList<String>();
-        DexFile df = new DexFile(GameApp.I.getPackageCodePath());//閫氳繃DexFile鏌ユ壘褰撳墠鐨凙PK涓彲鎵ц鏂囦欢
+        DexFile df = new DexFile(GameAppProxy.app.getPackageCodePath());//閫氳繃DexFile鏌ユ壘褰撳墠鐨凙PK涓彲鎵ц鏂囦欢
         Enumeration<String> enumeration = df.entries();//鑾峰彇df涓殑鍏冪礌  杩欓噷鍖呭惈浜嗘墍鏈夊彲鎵ц鐨勭被鍚� 璇ョ被鍚嶅寘鍚簡鍖呭悕+绫诲悕鐨勬柟寮�
         while (enumeration.hasMoreElements()) {//閬嶅巻
             String className = (String) enumeration.nextElement();
@@ -85,17 +85,21 @@
         return classNameList;
     }
 
+    public static void sendMessageToUnity(int code) {
+        UnityMsgHandler.sendMessageToUnity(code,null);
+    }
+
     /**
      * 鍙戦�佹秷鎭埌unity
      *
-     * @param jsonMap
+     * @param args
      */
-    public static void sendMessageToUnity(Map<String, Object> jsonMap) {
-        if (jsonMap == null || jsonMap.isEmpty()) {
-            return;
-        }
-        JSONObject jsonObject = new JSONObject(jsonMap);
-        if (GameApp.I.isDemo()) {
+    public static void sendMessageToUnity(int code, Map<String, Object> args) {
+        if (args == null)
+            args = new HashMap<>();
+        args.put("code", code);
+        JSONObject jsonObject = new JSONObject(args);
+        if (GameAppProxy.isDemo()) {
             LogUtil.debug("鍙戦�佹秷鎭埌unity", jsonObject.toString());
             return;
         }

--
Gitblit v1.8.0