Example #1
0
    /// <summary>
    /// 用unity自带的打包api设置info.plist
    /// </summary>
    /// <param name="pathToBuiltProject"></param>
    private static void EditInfoPlistWithUnity(string pathToBuiltProject)
    {
        string plistPath = pathToBuiltProject + "/Info.plist";

        UnityEditor.iOS.Xcode.Custom.PlistDocument plist = new UnityEditor.iOS.Xcode.Custom.PlistDocument();
        plist.ReadFromString(File.ReadAllText(plistPath));
        UnityEditor.iOS.Xcode.Custom.PlistElementDict rootDict = plist.root;
        packageManager.EditInfoPlistWithUnity(rootDict);
        plist.WriteToFile(plistPath);
    }