| | |
| | | } |
| | | |
| | | public static void sendMessageToUnity(int code) { |
| | | Map<String, Object> args = new HashMap<>(); |
| | | args.put("code", code); |
| | | UnityMsgHandler.sendMessageToUnity(args); |
| | | 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); |
| | | 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 (GameApp.I.isDemo()) { |
| | | LogUtil.debug("发送消息到unity", jsonObject.toString()); |
| | | return; |