| | |
| | | project.AddFrameworkToProject(fwTargetGUID, "authenticationservices.framework", true); |
| | | project.AddFrameworkToProject(fwTargetGUID, "LocalAuthentication.framework", true); |
| | | |
| | | //appsflyer |
| | | project.AddFrameworkToProject(fwTargetGUID, "AdSupport.framework", true); |
| | | project.AddFrameworkToProject(fwTargetGUID, "iAd.framework", true); |
| | | |
| | | // 处理 库文件 |
| | | project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libz.tbd", "Frameworks/libz.tbd", PBXSourceTree.Sdk)); |
| | | project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libsqlite3.tbd", "Frameworks/libsqlite3.tbd", PBXSourceTree.Sdk)); |
| | |
| | | |
| | | private static void ModifyFile(string projectPath) |
| | | { |
| | | //修改UnityAppController.mm 文件 |
| | | var _xclass = new XClass(projectPath + "/Classes/UnityAppController.mm"); |
| | | /**修改UnityAppController.mm 文件**/ |
| | | var xclass = new XClass(projectPath + "/Classes/UnityAppController.mm"); |
| | | //引入UniversalSDK |
| | | _xclass.WriteBelow("#include \"PluginBase/AppDelegateListener.h\"", "#include \"UniversalSDK.h\""); |
| | | xclass.WriteBelow("#include \"PluginBase/AppDelegateListener.h\"", "#include \"UniversalSDK.h\""); |
| | | //unity交互调用的方法 |
| | | string newCode = "\n" + |
| | | "extern \"C\" void IOSMessageHandle(const char* jsonString) {\n" + |
| | | " [GetAppController().universalSDK HandleUnityMessage:[NSString stringWithUTF8String:jsonString]];\n" + |
| | | "}"; |
| | | _xclass.WriteBelow("extern \"C\" ScreenOrientation UnityCurrentOrientation() { return GetAppController().unityView.contentOrientation; }", newCode); |
| | | xclass.WriteBelow("extern \"C\" ScreenOrientation UnityCurrentOrientation() { return GetAppController().unityView.contentOrientation; }", newCode); |
| | | //初始化UniversalSDK |
| | | newCode = "\n" + |
| | | " _universalSDK = [[UniversalSDK alloc] init];\n [_universalSDK QuickSDKInit:application didFinishLaunchingWithOptions:launchOptions];"; |
| | | _xclass.WriteBelow("[KeyboardDelegate Initialize];", newCode); |
| | | xclass.WriteBelow("[KeyboardDelegate Initialize];", newCode); |
| | | |
| | | //修改UnityAppController.h 文件 |
| | | _xclass = new XClass(projectPath + "/Classes/UnityAppController.h"); |
| | | _xclass.WriteBelow("@class DisplayConnection;", "@class UniversalSDK;"); |
| | | _xclass.WriteBelow("DisplayConnection* _mainDisplay;", "UniversalSDK* _universalSDK;"); |
| | | _xclass.WriteBelow("@property (readonly, copy, nonatomic) DisplayConnection* mainDisplay;", |
| | | |
| | | |
| | | /**修改UnityAppController.h 文件**/ |
| | | xclass = new XClass(projectPath + "/Classes/UnityAppController.h"); |
| | | xclass.WriteBelow("@class DisplayConnection;", "@class UniversalSDK;"); |
| | | xclass.WriteBelow("DisplayConnection* _mainDisplay;", "UniversalSDK* _universalSDK;"); |
| | | xclass.WriteBelow("@property (readonly, copy, nonatomic) DisplayConnection* mainDisplay;", |
| | | "@property (readonly, copy, nonatomic) UniversalSDK* universalSDK;"); |
| | | } |
| | | |