少年修仙传客户端基础资源
allez
2021-03-23 cf265b6b410871588cd73b4339963f084ab33fff
9527 apps flyer
1个文件已修改
26 ■■■■■ 已修改文件
Assets/Editor/XCodeProjectMod.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/XCodeProjectMod.cs
@@ -59,6 +59,10 @@
        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));
@@ -115,26 +119,28 @@
    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;");
    }