Example #1
0
    public static void Load(Action CallBack)
    {
        Debug.Log("Loading");
        numLoadClassesCompleted = 0;
        LoadCallBack            = CallBack;

        Debug.Log("Attempting Load");

        if (GlobalData.loadGame && File.Exists(Application.persistentDataPath + "/savedgame.gd"))
        {
            Debug.Log("Loading...");
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/savedgame.gd", FileMode.Open);
            SaveLoad.savedgame = (Game)bf.Deserialize(file);
            file.Close();
        }
        else
        {
            SaveLoad.savedgame = new Game();
            Debug.Log("New game created: " + (savedgame != null));
        }

        PlayerMain.Load(LoadHelper);
        //ItemInv.Load(LoadHelper);
        //StartingPos.Load(LoadHelper);
        //MonInv.Load(LoadHelper);
        //PlayerStats.Load(LoadHelper);
        //Debug.Log("both loaded");
    }