Ejemplo n.º 1
0
    public static void OnPostProcessBuild(BuildTarget target, string path)
    {
        if (BuildTarget.iOS == target)
        {
            PBXModifier mod     = new PBXModifier();
            string      pbxproj = Path.Combine(path, "Unity-iPhone.xcodeproj/project.pbxproj");
            if (!File.Exists(pbxproj))
            {
                return;
            }
            var lines = mod.applyTo(pbxproj);

            File.WriteAllLines(pbxproj, lines);
        }
    }
    [PostProcessBuild(100)]    //To make sure the other scripts are executed.
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
    {
        UnityEngine.Debug.Log("----Executing post process build phase----");
        PBXModifier mod     = new PBXModifier();
        string      pbxproj = Path.Combine(pathToBuildProject, "Unity-iPhone.xcodeproj/project.pbxproj");

        if (!File.Exists(pbxproj))
        {
            return;
        }

        var lines = mod.applyTo(pbxproj);

        File.WriteAllLines(pbxproj, lines);

        UnityEngine.Debug.Log("----Finished executing post process build phase");
    }