Example #1
0
        /// <summary>
        /// Saves the current library data to the current active file
        /// </summary>
        /// <returns></returns>
        public void Save()
        {
            if (activeFile == null)
            {
                Debug.Log("");
            }

            activeFile.linkedLibrary = this;
            SteamworksRemoteStorageManager.FileWrite(activeFile);
        }
Example #2
0
        /// <summary>
        /// Saves the file with a new name.
        /// Note that if the provided file name does not start with the filePrefix defined then it will be added
        /// </summary>
        /// <param name="fileName">The name to save as
        /// Note that if the provided file name does not start with the filePrefix defined then it will be added</param>
        /// <returns></returns>
        public void SaveAs(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            if (!fileName.StartsWith(filePrefix))
            {
                fileName = filePrefix + fileName;
            }

            var result = SteamworksRemoteStorageManager.FileWrite(fileName, this);

            if (result)
            {
                Debug.Log("[SteamDataLibrary.SaveAs] Saved '" + fileName + "' successfully.");
            }
            else
            {
                Debug.LogWarning("[SteamDataLibrary.SaveAs] Failed to save '" + fileName + "' to Steam Remote Storage.\nPlease consult https://partner.steamgames.com/doc/api/ISteamRemoteStorage#FileWrite for more information.");
            }
        }