ESave
ESave
ESave
  • ESave Documentation
  • Pro Comparison
  • đŸ•šī¸Getting Started
    • Installation
    • Example Scenes
    • Components
      • Save File Setup
      • Save Storage
  • đŸ“Ŋī¸Videos
    • Tutorial
  • 📄Scripting
    • Saving & Loading
      • Saving
      • Loading
      • Custom Serializable Objects
      • Example Script
    • Runtime Save Creation
      • Creating a Save File
      • Infinite Saves
        • Infinite Save Scripting
    • Runtime Save Deletion
    • Understanding Background Save & Load
    • Using the Save Storage
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
  • ⭐Rate Me?
Powered by GitBook
On this page
  1. Scripting

Runtime Save Creation

Find out how to create saves through code.

Important Information

Before we begin, it's important to note that new SaveFile() is not always creating a new save file in the users system. It will only create a new save file if there isn't a save file in the specified path with the specified file name.

For example, if we use the same SaveFileSetupData for 2 SaveFile instances, only 1 file will be created in the user's system. The 2 SaveFile instances will simply be editing the same file.

SaveFileSetupData saveFileSetupData = new SaveFileSetupData()
{
    fileName = "Save File",
    saveLocation = SaveLocation.PersistentDataPath,
    filePath = "Example/Path",
    encryptionMethod = EncryptionMethod.None,
    addToStorage = true
};

// Both of these will be editing the same save file
SaveFile saveFile1 = new SaveFile(saveFileSetupData);
SaveFile saveFile2 = new SaveFile(saveFileSetupData);

This is here for informational purposes only, and it is not recommended to do.

PreviousExample ScriptNextCreating a Save File

Last updated 11 months ago

📄