public void Save()
    {
        SceneOneSaveData save = new SceneOneSaveData(BuildDoorArray(), player.GetComponent <CharacterControllerAddition>().keyRing);
        string           mySavedCollection = JsonUtility.ToJson(save);

        PlayerPrefs.SetString("SceneOne", mySavedCollection);
    }
    public void NewGame()
    {
        SceneOneSaveData newGame   = new SceneOneSaveData();
        string           myNewGame = JsonUtility.ToJson(newGame);

        PlayerPrefs.SetString("SceneOne", myNewGame);
    }
 public void Load()
 {
     if (PlayerPrefs.HasKey("SceneOne"))
     {
         string           myLoadedCollection = PlayerPrefs.GetString("SceneOne");
         SceneOneSaveData loadedSave         = JsonUtility.FromJson <SceneOneSaveData>(myLoadedCollection);
         player.GetComponent <CharacterControllerAddition>().keyRing = loadedSave.keyRing;
         for (int i = 0; i < doors.Length; i++)
         {
             if (loadedSave.unlocked[i])
             {
                 doors[i].GetComponentInChildren <Lock>().UnlockDoor();
                 doors[i].GetComponentInChildren <Lock>().RemoveBarricade();
             }
             doors[i].GetComponentInChildren <Lock>().RendColor();
         }
         for (int i = 0; i < SceneOneKeyIndexes.Length; i++)
         {
             bool spawn = true;
             for (int j = 0; j < loadedSave.keyRing.Count; j++)
             {
                 if (SceneOneKeyIndexes[i] == loadedSave.keyRing[j])
                 {
                     spawn = false;
                 }
             }
             if (spawn)
             {
                 SpawnSceneOneKeys(i);
             }
         }
         for (int i = 0; i < loadedSave.keyRing.Count; i++)
         {
             if (loadedSave.keyRing[i] == 7)
             {
                 monsterOne.GetComponent <LightFreezeAI>().triggered = true;
             }
             if (loadedSave.keyRing[i] == 9)
             {
                 monsterTwo.GetComponent <LightFreezeAI>().triggered = true;
             }
             if (loadedSave.keyRing[i] == 2)
             {
                 monsterThree.GetComponent <LightFreezeAI>().triggered = true;
             }
         }
     }
 }