public static string UpdateString(string contents, iOSBuildType buildType)
        {
            XDocument doc = PlistDocument.ParseXmlNoDtd(contents);
            string    str = "";

            if (buildType != iOSBuildType.Debug)
            {
                if (buildType == iOSBuildType.Release)
                {
                    str = "ReleaseForRunning";
                }
            }
            else
            {
                str = "Debug";
            }
            XElement element = doc.Root.XPathSelectElement("./LaunchAction");

            if (element == null)
            {
                return(contents);
            }
            element.SetAttributeValue("buildConfiguration", str);
            return(PlistDocument.CleanDtdToString(doc));
        }
Esempio n. 2
0
        internal static string UpdateStringForBackgroundConstant(string contents, XibWithBackgroundData data, UnityEditor.iOS.DeviceType device)
        {
            bool      flag = true;
            XDocument doc  = PlistDocument.ParseXmlNoDtd(contents);

            flag &= UpdateLaunchScreenAllImageSizes(doc.Root, data, device);
            XElement parentEl = doc.Root.XPathSelectElement("./objects/view[@id='iN0-l3-epB']");

            if (parentEl == null)
            {
                flag = false;
            }
            else
            {
                flag &= SetBackgroundColorElement(parentEl, data.background);
                if (device == UnityEditor.iOS.DeviceType.iPhone)
                {
                    XElement el = parentEl.XPathSelectElement("./subviews/view[@id='eQG-9T-8bq']/constraints/constraint[@id='rU5-7V-ukh']");
                    flag &= SetConstantForConstraint(el, data.iPhonePortraitHorizontalSize);
                    el    = parentEl.XPathSelectElement("./subviews/view[@id='gVh-4A-1je']/constraints/constraint[@id='NjH-A4-Wg3']");
                    flag &= SetConstantForConstraint(el, data.iPhoneLandscapeVerticalSize);
                }
                if (device == UnityEditor.iOS.DeviceType.iPad)
                {
                    XElement element3 = parentEl.XPathSelectElement("./subviews/view[@id='7bp-Iv-3mp']/constraints/constraint[@id='0Cy-oZ-PWZ']");
                    flag &= SetConstantForConstraint(element3, data.iPadVerticalSize);
                }
            }
            if (!flag)
            {
                Debug.Log("Launch screen XIB file is malformed");
            }
            return(PlistDocument.CleanDtdToString(doc));
        }
Esempio n. 3
0
        internal static string RemoveiPhonePortraitViewImpl(string contents, string[] mainViewXpaths)
        {
            bool      flag = true;
            XDocument doc  = PlistDocument.ParseXmlNoDtd(contents);
            XElement  node = doc.Root.XPathSelectElement("./objects/view[@id='iN0-l3-epB']");

            if (node == null)
            {
                flag = false;
            }
            else
            {
                foreach (string str in mainViewXpaths)
                {
                    flag &= RemoveElement(node.XPathSelectElement(str));
                }
            }
            if (!flag)
            {
                Debug.Log("Could not delete portrait lauch screen view: launch screen XIB file is malformed");
            }
            return(PlistDocument.CleanDtdToString(doc));
        }
Esempio n. 4
0
        internal static string UpdateStringForBackgroundRelative(string contents, XibWithBackgroundData data, UnityEditor.iOS.DeviceType device)
        {
            bool      flag = true;
            XDocument doc  = PlistDocument.ParseXmlNoDtd(contents);

            flag &= UpdateLaunchScreenAllImageSizes(doc.Root, data, device);
            XElement parentEl = doc.Root.XPathSelectElement("./objects/view[@id='iN0-l3-epB']");

            if (parentEl == null)
            {
                flag = false;
            }
            else
            {
                flag &= SetBackgroundColorElement(parentEl, data.background);
                if (device == UnityEditor.iOS.DeviceType.iPhone)
                {
                    XElement first    = parentEl.XPathSelectElement("./constraints/constraint[@id='VWh-bq-Pfv']");
                    XElement second   = parentEl.XPathSelectElement("./constraints/constraint[@id='S6m-R2-QBg']");
                    XElement element4 = parentEl.XPathSelectElement("./constraints/constraint[@id='e2k-A9-5oM']");
                    XElement element5 = parentEl.XPathSelectElement("./constraints/constraint[@id='omh-z1-Che']");
                    flag &= SetRelativeSizeConstraints(data.iPhoneLandscapeRelativeVerticalSize, first, second, true);
                    flag &= SetRelativeSizeConstraints(data.iPhonePortraitRelativeHorizontalSize, element4, element5, false);
                }
                if (device == UnityEditor.iOS.DeviceType.iPad)
                {
                    XElement element6 = parentEl.XPathSelectElement("./constraints/constraint[@id='wWy-Vq-I9X']");
                    XElement element7 = parentEl.XPathSelectElement("./constraints/constraint[@id='FGm-8j-iPJ']");
                    flag &= SetRelativeSizeConstraints(data.iPadRelativeVerticalSize, element6, element7, true);
                }
            }
            if (!flag)
            {
                Debug.Log("Launch screen XIB file is malformed");
            }
            return(PlistDocument.CleanDtdToString(doc));
        }
Esempio n. 5
0
 public string WriteToString()
 {
     return(PlistDocument.CleanDtdToString(m_Doc, null).Replace("\r\n", "\n"));
 }