/** * <summary>Updates a MainData class with its own variables that need saving.</summary> * <param name = "mainData">The original MainData class</param> * <returns>The updated MainData class</returns> */ public MainData SaveMainData(MainData mainData) { GlobalVariables.DownloadAll(); mainData.runtimeVariablesData = SaveSystem.CreateVariablesData(GlobalVariables.GetAllVars(), false, VariableLocation.Global); mainData.customTokenData = GetCustomTokensAsString(); return(mainData); }
/** * <summary>Saves the current options to the active profile.</summary> * <param name = "updateVariables">If True, then the values of variables linked to options data will be updated in the options data</param> */ public static void SavePrefs(bool updateVariables = true) { if (Application.isPlaying && updateVariables) { // Linked Variables GlobalVariables.DownloadAll(); optionsData.linkedVariables = SaveSystem.CreateVariablesData(KickStarter.runtimeVariables.globalVars, true, VariableLocation.Global); } SavePrefsToID(GetActiveProfileID(), null, true); }