From 5bbcb15dc081ede6e6d390c81e7ec64901a1988a Mon Sep 17 00:00:00 2001
From: cehua_Czg <tingame100@163.com>
Date: 星期一, 22 四月 2019 16:30:34 +0800
Subject: [PATCH] 6666 第一章NPC配置
---
Assets/Editor/XCodeProjectMod.cs | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/Assets/Editor/XCodeProjectMod.cs b/Assets/Editor/XCodeProjectMod.cs
index 7b5fcec..05c1f74 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" +
@@ -126,15 +138,23 @@
newCode);
newCode = "\n" +
- " [[IAPManager shared] startManager];\n" +
" _universalSDK = [[UniversalSDK alloc] init];\n" +
" [_universalSDK JPushInit:launchOptions];";
//鍦ㄦ寚瀹氫唬鐮佸悗闈㈠鍔犱竴澶ц浠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