From c87f76b46e35d76cef3118ea221bfb83c2ea8abb Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 10 十月 2018 11:40:17 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_client

---
 Assets/Editor/XCodeProjectMod.cs |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/Assets/Editor/XCodeProjectMod.cs b/Assets/Editor/XCodeProjectMod.cs
index 7b5fcec..3109336 100644
--- a/Assets/Editor/XCodeProjectMod.cs
+++ b/Assets/Editor/XCodeProjectMod.cs
@@ -111,12 +111,24 @@
 
     private static void ModifyFile(string projectPath)
     {
+        bool _isMr = false;
+        string _mrPlistPath = Application.dataPath + "/Plugins/iOS/MyMRSDK/MRSDKInfo.plist";
+        if (File.Exists(_mrPlistPath))
+        {
+            _isMr = true;
+        }
+
         // -------------- UnityAppController.mm
         //璇诲彇UnityAppController.mm鏂囦欢
         var _xclass = new XClass(projectPath + "/Classes/UnityAppController.mm");
 
         //鍦ㄦ寚瀹氫唬鐮佸悗闈㈠鍔犱竴琛屼唬鐮�
-        _xclass.WriteBelow("#include \"PluginBase/AppDelegateListener.h\"", "#include \"UniversalSDK.h\"\n#include \"JPushService.h\"\n#include \"IAPManager.h\"");
+        _xclass.WriteBelow("#include \"PluginBase/AppDelegateListener.h\"", "#include \"UniversalSDK.h\"\n#include \"JPushService.h\"\n");
+
+        if(_isMr)
+        {
+            _xclass.WriteBelow("#include \"PluginBase/AppDelegateListener.h\"","#include \"IAPManager.h\"\n");
+        }
 
         string newCode = "\n" +
                          "extern \"C\" void IOSMessageHandle(const char* jsonString) {\n" +
@@ -132,9 +144,18 @@
 
         //鍦ㄦ寚瀹氫唬鐮佸悗闈㈠鍔犱竴澶ц浠g爜
         _xclass.WriteBelow("[KeyboardDelegate Initialize];", newCode);
+        
+        if(_isMr)
+        {
+            _xclass.WriteBelow("[KeyboardDelegate Initialize];", "    [[IAPManager shared] startManager];\n");
+        }
 
         _xclass.WriteBelow("UnitySendDeviceToken(deviceToken);", "    [JPUSHService registerDeviceToken:deviceToken];");
-        _xclass.WriteBelow("SensorsCleanup();", "    [[IAPManager shared] startManager];");
+
+        if(_isMr)
+        {
+            _xclass.WriteBelow("SensorsCleanup();", "    [[IAPManager shared] stopManager];");
+        }
 
         newCode = "UnitySendRemoteNotification(userInfo);\n" +
             "    [JPUSHService handleRemoteNotification:userInfo];\n";

--
Gitblit v1.8.0