public static void SaveManifest() { #if !(UNITY_WP8 || UNITY_METRO) SA_FileStaticAPI.CreateFolder(MANIFEST_FOLDER_PATH); XmlDocument newDoc = new XmlDocument(); //Create XML header XmlNode docNode = newDoc.CreateXmlDeclaration("1.0", "UTF-8", null); newDoc.AppendChild(docNode); XmlElement child = newDoc.CreateElement("manifest"); _manifestTemplate.ToXmlElement(newDoc, child); newDoc.AppendChild(child); newDoc.Save(Application.dataPath + MANIFEST_FILE_PATH); //Replace 'android___' pattern with 'android:' TextReader reader = new StreamReader(Application.dataPath + MANIFEST_FILE_PATH); string src = reader.ReadToEnd(); string pattern = @"android___"; string replacement = "android:"; Regex regex = new Regex(pattern); src = regex.Replace(src, replacement); reader.Close(); TextWriter writer = new StreamWriter(Application.dataPath + MANIFEST_FILE_PATH); writer.Write(src); writer.Close(); AssetDatabase.Refresh(); #endif }
static AndroidNativeInit() { #if UNITY_ANDROID if (SA_FileStaticAPI.IsFileExists("Extensions/UltimateMobile/Resources/UltimateMobileSettings.asset")) { return; } if (!AndroidNativeSettingsEditor.IsInstalled) { EditorApplication.update += OnEditorLoaded; } else { if (!AndroidNativeSettingsEditor.IsUpToDate) { EditorApplication.update += OnEditorLoaded; } } #endif }