Ejemplo n.º 1
0
        /// <summary>
        /// <para>Eng. Pushed Saved Button. </para>
        /// <para>Kor. 저장된 게임 버튼을 눌렀습니다. </para>
        /// </summary>
        public void SavedButtonPushed(GameObject _pushedButton)
        {
            switch (_state)
            {
            case SaveLoadSlotManagerState.NewGameSave:
                _pushedSavedButton = _pushedButton;
                _rewritePanel.SetActive(true);
                break;

            case SaveLoadSlotManagerState.OptionSave:
                _pushedSavedButton = _pushedButton;
                _rewritePanel.SetActive(true);
                break;

            case SaveLoadSlotManagerState.Load:
                _pushedSavedButton = _pushedButton;
                VinoveGameSaveData _savedData = _pushedSavedButton.GetComponent <SavedButtonManager>()._savedData;
                InGameManager.GetInstance().LoadGameByScript(_savedData);
                DisableSlot();
                MainMenuManager.GetInstance().DisableMainMenu();
                InGameManager.GetInstance().VinoveInitialize();
                InGameManager.GetInstance().GameState = Enum.GameState.InGame;
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Eng. Load all save file in local save folder </para>
        /// <para>Kor. 세이브 폴더내에 저장된 파일을 게임으로 모두 불러옵니다. </para>
        /// </summary>
        void ReloadSaveFile(VinoveGameSaveData _saveData)
        {
            VinoveScript _script = InGameManager.GetInstance()._currentVinove.FindSceneWithUID(_saveData._parentSceneUID).FindScriptWithUID(_saveData._scriptUID);

            _pushedSavedButton.GetComponent <SavedButtonManager>().ChangeSaveData(_saveData);
            _pushedSavedButton.GetComponent <SavedButtonManager>().ChangeTexts(_saveData._savedDate, _script.ScriptConversation.Speaker, _script.ScriptConversation.Dialog);

            _pushedSavedButton = null;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <para>Eng. Load all save file in local save folder </para>
        /// <para>Kor. 세이브 폴더내에 저장된 파일을 게임으로 모두 불러옵니다. </para>
        /// </summary>
        void ReloadSaveFile(string _path)
        {
            VinoveGameSaveData _saveData = BinaryIOManager.GetInst().BinaryDeserialize <VinoveGameSaveData>(_path);

            _saveDatas.Add(_saveData);

            VinoveScript _script = InGameManager.GetInstance()._currentVinove.FindSceneWithUID(_saveData._parentSceneUID).FindScriptWithUID(_saveData._scriptUID);

            GameObject _instantiatedButton = Instantiate(_savedFileButtonPrefab, _contentParent.transform);

            _instantiatedButton.GetComponent <SavedButtonManager>().ChangeSaveData(_saveData);
            _instantiatedButton.GetComponent <SavedButtonManager>().ChangeTexts(_saveData._savedDate, _script.ScriptConversation.Speaker, _script.ScriptConversation.Dialog);
            _savedFileButtons.Add(_instantiatedButton);
        }
Ejemplo n.º 4
0
        ///////////////////////////////
        /// Save & Load Sequence

        /// <summary>
        /// <para>Eng. Load all save file in local save folder </para>
        /// <para>Kor. 세이브 폴더내에 저장된 파일을 게임으로 모두 불러옵니다. </para>
        /// </summary>
        void ReloadSaveFiles()
        {
            DirectoryInfo info = new System.IO.DirectoryInfo(_saveFolderDir);

            FileInfo [] fileInfo = info.GetFiles();

            foreach (FileInfo file in fileInfo)
            {
                if (file.Name.EndsWith(".sav"))
                {
                    VinoveGameSaveData _saveData = BinaryIOManager.GetInst().BinaryDeserialize <VinoveGameSaveData>(file.FullName);
                    _saveDatas.Add(_saveData);

                    VinoveScript _script = InGameManager.GetInstance()._currentVinove.FindSceneWithUID(_saveData._parentSceneUID).FindScriptWithUID(_saveData._scriptUID);

                    GameObject _instantiatedButton = Instantiate(_savedFileButtonPrefab, _contentParent.transform);
                    _instantiatedButton.GetComponent <SavedButtonManager>().ChangeSaveData(_saveData);
                    _instantiatedButton.GetComponent <SavedButtonManager>().ChangeTexts(_saveData._savedDate, _script.ScriptConversation.Speaker, _script.ScriptConversation.Dialog);
                    _savedFileButtons.Add(_instantiatedButton);
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// <para>Eng. Create class for archive and save to file. </para>
        /// <para>Kor. 저장용 클래스를 생성하고, 파일화 하여 저장합니다. </para>
        /// </summary>
        void SaveData()
        {
            VinoveGameSaveData _saveData = new VinoveGameSaveData();

            _saveData._parentSceneUID          = _parentSceneUID;
            _saveData._scriptUID               = _saveTargetUID;
            _saveData._speakerIllustKey        = _speakerIllustKey;
            _saveData._speakerIllustColorAlpha = _speakerIllustColorAlpha;
            _saveData._speakerIllustActivated  = _speakerIllustActivated;

            _saveData._savedDate = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");

            BinaryIOManager.GetInst().BinarySerialize <VinoveGameSaveData>(_saveData, _saveFolderDir + _saveData._savedDate + ".sav");

            ReloadSaveFile(_saveFolderDir + _saveData._savedDate + ".sav");

            if (_state == SaveLoadSlotManagerState.NewGameSave)
            {
                DisableSlot();
                MainMenuManager.GetInstance().DisableMainMenu();
                InGameManager.GetInstance().NewGameInitialize();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// <para>Eng. Create class for archive and save to file. </para>
        /// <para>Kor. 저장용 클래스를 생성하고, 파일화 하여 저장합니다. </para>
        /// </summary>
        void SaveData(GameObject _button)
        {
            VinoveGameSaveData _saveData = _button.GetComponent <SavedButtonManager>()._savedData;
            string             _tmpDate  = _saveData._savedDate;

            _saveData._parentSceneUID          = _parentSceneUID;
            _saveData._scriptUID               = _saveTargetUID;
            _saveData._savedDate               = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
            _saveData._speakerIllustKey        = _speakerIllustKey;
            _saveData._speakerIllustColorAlpha = _speakerIllustColorAlpha;
            _saveData._speakerIllustActivated  = _speakerIllustActivated;

            System.IO.File.Delete(_saveFolderDir + _tmpDate + ".sav");
            BinaryIOManager.GetInst().BinarySerialize <VinoveGameSaveData>(_saveData, _saveFolderDir + _saveData._savedDate + ".sav");

            ReloadSaveFile(_saveData);

            if (_state == SaveLoadSlotManagerState.NewGameSave)
            {
                DisableSlot();
                MainMenuManager.GetInstance().DisableMainMenu();
                InGameManager.GetInstance().NewGameInitialize();
            }
        }
Ejemplo n.º 7
0
        ////////////////////////////////////////////////////////////////////////
        /// Func


        /// <summary>
        /// <para>Eng. Change Saved Data. </para>
        /// <para>Kor. 저장 데이터를 변경합니다. </para>
        /// </summary>
        public void ChangeSaveData(VinoveGameSaveData _data)
        {
            _savedData = _data;
        }