Exemplo n.º 1
0
    //co rotina de transiçao de scena
    private IEnumerator Transition()
    {
        //se o index da cena escolido for menor que 0 -> erro
        if (chsSceneIndx < 0)
        {
            Debug.LogError("Scene index invalid."); yield break;
        }

        DontDestroyOnLoad(gameObject);                           //nao destoi no carregamento

        const string svF  = "Save";                              //referencia do arquivo de auto save
        SavingSystem svS  = FindObjectOfType <SavingSystem>();   //referencia a script de salvar
        Fader        fade = FindObjectOfType <Fader>();          //referencia do script para fade

        DisableCtrl();                                           //tira controles do personagem
        yield return(fade.FadeOut(fadeTimer));                   //faz fade

        svS.Save(svF);                                           //salva jogo
        yield return(SceneManager.LoadSceneAsync(chsSceneIndx)); //carrega cenario

        DisableCtrl();                                           //tira controles do personagem
        svS.Load(svF);                                           //carrega save

        Portal otherPortal = GetOtherPortal();                   //referencia do portal de entrada

        UpdatePlayer(otherPortal);                               //update as informacoes do jogador
        svS.Save(svF);                                           //salva

        yield return(new WaitForSeconds(0.5f));

        yield return(fade.FadeIn(fadeTimer)); //cria fade

        EnableCtrl();                         //reativa os controles do personagem
        Destroy(gameObject);                  //deleta objeto
    }
Exemplo n.º 2
0
        public void SaveAndLoadTest()
        {
            string fileName = "TempUnitTestFile.bin";

            HighScoreData highScoreDataSaved = new HighScoreData();

            SavingSystem <HighScoreData> .Save(highScoreDataSaved, fileName);

            HighScoreData highScoreDataLoaded = SavingSystem <HighScoreData> .Load(fileName);

            Assert.AreEqual(highScoreDataSaved, highScoreDataLoaded);
        }
Exemplo n.º 3
0
        public void LoadSelectedGame()
        {
            if (!_savingSystem.SaveExists(_saveFileName))
            {
                return;
            }

            GameManager.Instance.EndTitleMusic();

            _savingSystem.Load(_saveFileName);

            Hide();
        }
Exemplo n.º 4
0
        static async Task LoadApplications()
        {
            Console.WriteLine("Loading Application Forms");
            Dictionary <string, object> loadedApplications = SavingSystem.Load(APPLICATIONS);

            foreach (object application in loadedApplications.Values)
            {
                Application loadedApplication = new Application("_LoadedApplication_");
                await loadedApplication.RestoreState(application).ConfigureAwait(false);

                applications.Add(loadedApplication);
                Log("Application " + loadedApplication.Title + " : Loaded", ConsoleColor.Green);
            }


            Console.WriteLine("Loading Finished Applications");
            Dictionary <string, object> loadedFinishedApplications = SavingSystem.Load(FINISHED_APPLICATIONS);

            foreach (object loadedFinishedApplication in loadedFinishedApplications.Values)
            {
                try
                {
                    PendingApplication application = new PendingApplication(null, null, null, loadedFinishedApplication);
                    await application.RestoreState(loadedFinishedApplication).ConfigureAwait(false);

                    Log(
                        "Pending Application " + application.Message.Id +
                        " for " + application.Message.Channel.GuildId +
                        " in " + application.Message.ChannelId + " : Loaded", ConsoleColor.Green);
                    pendingApplications.Add(application);

                    AddInteractivity(application);
                }
                catch
                {
                    Log("Dead application found and skipped", ConsoleColor.Red);
                }
            }
        }
Exemplo n.º 5
0
 public void Load()
 {
     sSystem.Load(Constant.defaultSaveFile);
 }
Exemplo n.º 6
0
 public void Load()
 {
     // Call saving system to load
     _savingSystem.Load(_defaultSaveFile);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Public interface for loading the game
 /// </summary>
 public void Load()
 {
     m_SaveSystem.Load(m_DefaultSaveFile);
 }
Exemplo n.º 8
0
 public void Load()
 {
     print("Load");
     savingSystem.Load(defaultSaveFile);
 }
Exemplo n.º 9
0
 private void Load()
 {
     savingSystem.Load(defaultSaveFile);
 }
Exemplo n.º 10
0
 public void Load()
 {
     _savingSystem.Load(DefaultSaveFile);
 }
Exemplo n.º 11
0
 public void Load()
 {
     savingSystem.Load(defaultSaveFile);
 }
Exemplo n.º 12
0
    public void LoadCurrentHighScore()
    {
        HighScoreData highScoreData = SavingSystem <HighScoreData> .Load(fileName);

        _highScore = highScoreData.HighScore;
    }
 public void Load()
 {
     StartCoroutine(fader.FadeIn(fadeTime));
     savingSystem.Load(DEFAULT_SAVE_FILE);
 }
Exemplo n.º 14
0
 public void Load()
 {
     savingSystem.Load(fileName);
 }
Exemplo n.º 15
0
 public void Load()
 {
     _ss.Load(DefaultSaveFile);
 }