Пример #1
0
        public void Load(string fileName)
        {
            saveInfo = new SaveInfo();
            if (!File.Exists(Application.dataPath + "/saves/" + fileName))
            {
                return;
            }

            Debug.Log(Application.dataPath + "/saves/" + fileName);

            Stream          stream     = File.Open(Application.dataPath + "/saves/" + fileName, FileMode.Open);
            BinaryFormatter bformatter = new BinaryFormatter();

            bformatter.Binder = new PathGameSaveBinder();
            saveInfo          = (SaveInfo)bformatter.Deserialize(stream);
            foreach (PersonDialog pd in FindObjectsOfType <PersonDialog>())
            {
                //pd.PersonChain = saveInfo.personsChains[pd.gameObject];
            }
            stream.Close();

            DialogPlayer.Instance.PlayState(GuidManager.GetStateByGuid(saveInfo.lastState), FindObjectOfType <PersonDialog>());
        }