Recall & Review
beginner
What is a file-based save system in Unity?
A file-based save system stores game data by writing it to files on the device's storage. This allows the game to save and load player progress or settings between sessions.
Click to reveal answer
beginner
Which Unity class is commonly used to write and read text files for saving data?The <code>System.IO.File</code> class is commonly used to write and read text files in Unity for saving and loading data.Click to reveal answer
beginner
Why is JSON a popular format for saving game data in Unity?
JSON is easy to read and write, human-readable, and supported by Unity's
JsonUtility class, making it simple to convert game data to and from strings for file storage.Click to reveal answer
beginner
What is the purpose of
Application.persistentDataPath in Unity?Application.persistentDataPath gives a safe folder path where you can save files that persist between game sessions and are not deleted when the app updates.Click to reveal answer
intermediate
How do you ensure data is saved safely when writing to a file in Unity?
You can write data to a temporary file first, then replace the original file. Also, use try-catch blocks to handle errors and avoid corrupting save files.
Click to reveal answer
Which Unity method converts an object to a JSON string for saving?
✗ Incorrect
JsonUtility.ToJson() converts an object to a JSON string.Where should you save files to ensure they persist on all platforms in Unity?
✗ Incorrect
Application.persistentDataPath is the recommended location for persistent save files.Which namespace provides classes for file operations in Unity?
✗ Incorrect
System.IO contains classes like File and StreamWriter for file handling.What is a common risk when writing save files directly without error handling?
✗ Incorrect
Without error handling, interrupted writes can corrupt save files.
Which method reads all text from a file in Unity?
✗ Incorrect
File.ReadAllText() reads the entire content of a text file.Explain how to save and load game data using a file-based save system in Unity.
Think about file location, converting data to string, and reading it back.
You got /5 concepts.
What are best practices to avoid corrupting save files when writing data in Unity?
Consider error handling and safe file replacement.
You got /4 concepts.