| | |
| | | |
| | | import com.unity3d.player.UnityPlayer; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.BufferedReader; |
| | |
| | | |
| | | JSONObject _jsonObject = new JSONObject(jsonMap); |
| | | |
| | | UnityPlayer.UnitySendMessage(StaticDefine.UnityGameObjectName, |
| | | StaticDefine.UnityHandleFuncName, |
| | | _jsonObject.toString()); |
| | | } |
| | | |
| | | public static void sendDebugLogToUnity(String content) |
| | | { |
| | | JSONObject _jsonObject = new JSONObject(); |
| | | try |
| | | { |
| | | _jsonObject.put("code", 6); |
| | | _jsonObject.put("info", content); |
| | | } catch (JSONException e) |
| | | { |
| | | e.printStackTrace(); |
| | | } |
| | | UnityPlayer.UnitySendMessage(StaticDefine.UnityGameObjectName, |
| | | StaticDefine.UnityHandleFuncName, |
| | | _jsonObject.toString()); |
| | |
| | | return -1; |
| | | } |
| | | |
| | | public static boolean isEmpty(String s) { |
| | | public static boolean isEmpty(String s) |
| | | { |
| | | if (null == s) |
| | | { |
| | | return true; |
| | | } |
| | | if (s.length() == 0) |
| | | { |
| | | return true; |
| | | } |
| | | if (s.trim().length() == 0) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |