/// <summary> /// Enable's ot disable's script define line /// </summary> /// <param name="file">path to a script file</param> /// <param name="define">defined name</param> /// <param name="isEnabled">new define state</param> public static void ChangeScriptDefineState(string file, string define, bool isEnabled) { if (SA_FilesUtil.IsFileExists(file)) { string content = SA_FilesUtil.Read(file); int endlineIndex; endlineIndex = content.IndexOf(System.Environment.NewLine, System.StringComparison.CurrentCulture); if (endlineIndex == -1) { endlineIndex = content.IndexOf("\n", System.StringComparison.CurrentCulture); } string TagLine = content.Substring(0, endlineIndex); if (isEnabled) { content = content.Replace(TagLine, "#define " + define); } else { content = content.Replace(TagLine, "//#define " + define); } SA_FilesUtil.Write(file, content); } }
private static string GetStringVersionId(string versionFilePath) { if (SA_FilesUtil.IsFileExists(versionFilePath)) { return(SA_FilesUtil.Read(versionFilePath)); } else { return("0.0"); } }
public static void LoadLocalGamesIds() { string rawData = SA_FilesUtil.Read(AN_Settings.ANDROID_GAMES_IDS_FILE_PATH); s_gamesIds = new AN_GamesIds(rawData); }
private static int GetVersionCode(string versionFilePath) { string stringVersionId = SA_FilesUtil.Read(versionFilePath); return(ParceVersion(stringVersionId)); }