Example #1
0
        /// <summary>
        /// Saves the current library data to the current active file
        /// </summary>
        /// <returns></returns>
        public void SaveAsync()
        {
            activeFile.linkedLibrary = this;
            var file = SteamworksRemoteStorageManager.FileWriteAsync(activeFile);

            if (file.result != Steamworks.EResult.k_EResultFail)
            {
                file.Complete = results =>
                {
                    activeFile = results;
                };
            }
        }
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 SaveAsAsync(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

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

            var file = SteamworksRemoteStorageManager.FileWriteAsync(fileName, this);

            if (file.result != Steamworks.EResult.k_EResultFail)
            {
                file.Complete = results =>
                {
                    activeFile = results;
                };
            }
        }