I have no idea why but my save and load system (based on the one seen here) has stopped working. I ran a test with it when I first finished writing it but it’s stopped working for (probably a lot of) reasons which I can’t figure out, the problem is that it’s a logic error and I’m not getting much to go off, plus there’s a LOT of code involved. Here’s just the code involved with the primary saving and loading, if anyone asks for the other classes referenced I’ll send it, just please help.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SettingAndValue : MonoBehaviour
{
//Creates values that need to be saved in settings
//Decided whether videos will loop
public static bool Loop = true;
//Creates values that will be saved between pages
public static string[] ValueStringArray = TempValueHandler.ValueStringArray;
public static int ValueInt = TempValueHandler.ValueInt;
//Creates values that store tags
public static List<string> A = TagHandler.A;
public static List<string> B = TagHandler.B;
public static List<string> C = TagHandler.C;
public static List<string> D = TagHandler.D;
public static List<string> E = TagHandler.E;
public static List<string> F = TagHandler.F;
public static List<string> G = TagHandler.G;
public static List<string> H = TagHandler.H;
public static List<string> I = TagHandler.I;
public static List<string> J = TagHandler.J;
//Creates values related to password protection
public static List<string> Passwords = PasswordHandler.Passwords;
public static List<string> PassProt = PasswordHandler.PassProt;
public static Dictionary<string, string> PassKey = PasswordHandler.PassKey;
public static List<string> PassUnlock = PasswordHandler.PassUnlock;
//Creates values related to file sorting/searching
public static Dictionary<string, List<string>> FileDictionary = SortingHandler.FileDictionary;
public void SaveState(SettingAndValue saver)
{
SaveSystem.SaveGameData(saver);
}
public static void LoadSettings()
{
SaveData data = SaveSystem.LoadSave();
Loop = data.Loop;
Debug.Log("Settings Data Loaded");
}
public static void LoadTempValues()
{
SaveData data = SaveSystem.LoadSave();
ValueStringArray = data.ValueStringArray;
ValueInt = data.ValueInt;
Debug.Log("TempValue Data Loaded");
}
public static void LoadTags()
{
SaveData data = SaveSystem.LoadSave();
A = data.A;
B = data.B;
C = data.C;
D = data.D;
E = data.E;
F = data.F;
G = data.G;
H = data.H;
I = data.I;
J = data.J;
Debug.Log("Tag Data Loaded");
}
public static void LoadPasswordSettings()
{
SaveData data = SaveSystem.LoadSave();
Passwords = data.Passwords;
PassProt = data.PassProt;
PassKey = data.PassKey;
PassUnlock = data.PassUnlock;
Debug.Log("Password Data Loaded");
}
public static void LoadSortSearch()
{
SaveData data = SaveSystem.LoadSave();
FileDictionary = data.FileDictionary;
Debug.Log("Sorting Data Loaded");
}
public void LoadAll()
{
LoadSettings();
LoadTempValues();
LoadTags();
LoadPasswordSettings();
LoadSortSearch();
Debug.Log("All Data Loaded");
}
}