USK - Documentaion
  • 🖖Welcome
  • 📥Installation
  • 🗃️Project Overview
  • 🛠️Get Started
  • ↔️Migration Guide
  • ⚙️Project Settings
    • Input System
    • UI Manager
  • 👤Characters
    • Overview
    • Creation
    • Adjustment
      • Character
      • Camera
    • Controller
      • Movement
        • Change Movement Animations
      • Health
      • Tags
      • Noise
    • Camera
      • First Person
      • Third Person
      • Top Down
    • Inventory Manager
      • Usage
      • Fists Attack
      • Drop Weapons
    • Multiplayer
  • 🔫Weapons
    • Overview
    • Creation
    • Adjustment
      • IK Tools
    • Weapon Controller
      • Attacks
      • Aim Settings
        • First Person
        • Third Person
        • Top Down
      • Animations
        • Animated Weapons
    • Usage
  • 🤖AI Opponents
    • Overview
    • Creation
    • AI Controller
      • In-game Behaviour
      • Detection Parameters
      • Attack
      • Movement
      • Health
    • Multiplayer
    • Adding to the Game
      • Waypoints
      • Covers
      • Stealth Zone (Grass)
  • 📦Integrations Manager
    • Overview
    • Emerald AI
    • Realistic Car Controller
    • Edy's Vehicle Physics
    • NWH Vehicle Physics 2
    • Destroy It
    • Easy Save 3
  • 🕹️Single-player Game Creation
    • Creation
  • 👥Multiplayer Game Creation
    • Overview
    • Activation
    • Lobby
    • Rooms
  • 📱Mobile Control
    • Activation and Usage
    • Mobile Debug
  • Other Components
    • 💾Save Manager
    • 🎯Spawn Zones
    • 🗺️Minimaps
      • Texture Recommendations
    • 🩸Blood Splatter
    • 📤Pickup Items
    • 🪵Surfaces
    • ⚡Animation Events
  • ✨Render Pipelines
    • Project Update
    • Post-processing Effects
  • Additional Info
    • ▶️Video Guides
    • ❓FAQ
Powered by GitBook
On this page
  • Adding to the game
  • How it works
  • Custom Save Data
  • Easy Save Integration

Was this helpful?

  1. Other Components

Save Manager

PreviousMobile DebugNextSpawn Zones

Last updated 2 years ago

Was this helpful?

There are 2 demo scenes in the project (Universal Shooter Kit -> Demos -> Scenes -> SinglePlayer -> Save System -> Save System (Scene 1) / (Scene 2))

Open and run one of them to test the Save System.

Adding to the game

To create a save system in your game, add a SaveManager script to any object in your scene.

In this script you can choose which parameters will be saved, as well as enable autosave mode.

If you're going to save your character's inventory, make sure all the weapons you use are in the special pool (Tools -> USK -> Project Settings -> Weapons Pool).

If your game has weapons that can be picked up, they should be added to the pool as well. Or add weapon prefabs to your scene and don't unpack them.

How it works

  • (Load) Every time you load a scene with the SaveManager component in it, all saved progress is loaded and applied (depending on which parameters you have activated).

  • (Save) To save your progress, you need to call the save function (anywhere and at any time):

SaveManager.Instance.SaveData();
  • (Clear) To clear all progress, call the following function:

SaveManager.Instance.DeleteAllSavedData();

In the manager 2 classes are saved separately: the first class - "Character Data", the second - "Scene Data".

Character Data is saved in a single copy (contains character health and inventory values)

Scene Data is saved for each scene separately (contains the position of the character, dropped/picked up items, and AI parameters) and refers to scenes by their names (please note: when you rename a scene, the linked save won't be loaded)

Custom Save Data

If you need to save some other parameters, use the prepared CustomData class in the SaveManager script.

Also, you need to apply the loaded parameters after loading the save files.

Easy Save Integration

By default, all data is saved to JSON files without encryption. If you want to expand these features, then activate an integration with the Easy Save system.

You can only save serializable variables - .

💾
Unity Docs
Easy Save 3