Tier 2 Series 106

106G: The Vault Exam

Capstone Exam
"The save system is failing. The high score resets when the game is closed, the inventory fails to load on Android, and the save file works on PC but crashes on Mac. Identify the three critical data failures."

Target Asset for Audit

FRAGILE_CODE_DETECTED
using UnityEngine;
using System.IO;

public class SaveSystem : MonoBehaviour {
    // Audit Requirement: Lesson 106A (Persistence)
    // Error 1: Static Variable
    public static int HighScore; 

    public void SaveGame() {
        // Audit Requirement: Lesson 106E (File Path)
        // Error 2: Hardcoded Path
        string path = "C:/GameData/save.json";
        File.WriteAllText(path, "...");
    }

    public void LoadGame() {
        // Audit Requirement: Lesson 106B (Keys)
        // Error 3: Typo in Key
        // Saved as "Gold", loading as "gold"
        int gold = PlayerPrefs.GetInt("gold");
    }
}

Supervisor's Certification

Authenticated Pilot
pilot_294cb8a75839816b
Session Secure

Failure Point #1

Volatile Memory Failure

The AI is using a static variable for persistence. Command it to use PlayerPrefs or File I/O.

Failure Point #2

Path Dependency Failure

The AI hardcoded a C:/ drive path. Command it to use PersistentDataPath.

Failure Point #3

Key Consistency Failure

The AI used a magic string with a typo. Command it to use a const string Key.