Example #1
0
    public void load()
    {
        if (File.Exists(Application.persistentDataPath + "/gameInfo.dat"))
        {
            BinaryFormatter binaryformatterload = new BinaryFormatter();
            FileStream      file       = File.Open(Application.persistentDataPath + "/gameInfo.dat", FileMode.Open);
            Saveobject      saveobject = (Saveobject)binaryformatterload.Deserialize(file);

            Debug.Log(Application.persistentDataPath + "/gameInfo.dat");
            file.Close();

            saveslot = saveobject;
            loadImportantVariables();
        }
    }
Example #2
0
    void Awake()
    {
        //ItemDatabaseNow = load ();
        saveslot = new Saveobject();
        if (savesystem == null)
        {
            savesystem = this;
        }


        /*	if(savesystem == null){
         *              //DontDestroyOnLoad (gameObject);
         *              savesystem = this;
         *      }else if( savesystem != this){
         *              Destroy (gameObject);
         *      }
         */
    }