Beispiel #1
0
        void saveGame()
        {
            var save = list.SelectedSave;

            if (save == null)
            {
                return;
            }

            var @new = game.Save.Copy();

            void action1()
            {
                game.ShowScreen(ScreenType.SAVEGAME);
            }

            void action2()
            {
                game.ShowScreen(ScreenType.MENU);
                GameSaveManager.SaveOnNewName(@new, save.Name, game);
                game.AddInfoMessage(150, "Game Saved!");
                Log.Debug($"Overrided game save ({@new.Name}->{save.SaveName}).");
            }

            game.ShowDecisionScreen(action1, action2, "Are you sure you want to override?");
        }
Beispiel #2
0
 void Start()
 {
     gameSaveManagerInstance = GameSaveManager.instance;
     gameSaveManagerInstance.LoadGame(soPlayerStats);
     objectPoolerInstance = ObjectPooler.instance;
     audioManagerInstance = AudioManager.instance;
     metersTraveled       = 0;
     audioManagerInstance.PlayTriggerSound(engineStart.clip, engineStart.Volume);
     Invoke("PlayEngineTopSpeedSound", engineStart.clip.length);
     rb = GetComponent <Rigidbody>();
     for (int i = 0; i < meshParts.Length; i++)
     {
         meshParts[i].material = Resources.Load <Material>(soPlayerStats.materialName);
     }
     auxJumpChargeTime = jumpChargeTime;
     auxFlickingTime   = flickingTime;
     for (int i = 0; i < skildMarks.Length; i++)
     {
         skildMarks[i].emitting = false;
     }
     for (int i = 0; i < nitroParticles.Length; i++)
     {
         nitroParticles[i].Stop();
     }
 }
Beispiel #3
0
        private void CheckForEnd()
        {
            Debug.Log("Ending");
            //if (_video.frame >= 3813)
            {
                isCovering = true;
                if (FailFrames > 900 && FailFrames < 1200)
                {
                    Debug.Log("Ending1");
                    //finalScore.ModifyScoreTSP(-1, 0, 1);
                    GameSaveManager.StoreScore(-1, 0, 1, 0);
                    GameStateManager.STATE = GameStateManager.GameState.MailReading;
                    SceneManager.LoadScene("EndingScene");
                }
                else if (FailFrames >= 1200)
                {
                    Debug.Log("Ending2");
                    GameSaveManager.StoreScore(1, 0, -1, 1);
                    GameStateManager.STATE = GameStateManager.GameState.MailReading;
                    SceneManager.LoadScene("TechnicalDifficultyEnding");
                }
                else
                {
                    Debug.Log("Ending3");
                    GameSaveManager.StoreScore(1, 0, -1, 0);
                    GameStateManager.STATE = GameStateManager.GameState.MailReading;
                    SceneManager.LoadScene("EndingScene");
                }
            }

            /*else
             * {
             *      CheckForPants();
             * }*/
        }
Beispiel #4
0
 private void CheckForEnd()
 {
     if (_video.frame > 2769)
     {
         isCovering = true;
         if (FailFrames > 900 && FailFrames < 1200)
         {
             //finalScore.ModifyScoreTSP(-1, 0, 1);
             GameSaveManager.StoreScore(-1, 0, 1, 0);
             GameStateManager.STATE = GameStateManager.GameState.MailReading;
             SceneManager.LoadScene("MainFrame");
         }
         else if (FailFrames >= 1200)
         {
             GameSaveManager.StoreScore(1, 0, -1, 1);
             GameStateManager.STATE = GameStateManager.GameState.MailReading;
             SceneManager.LoadScene("TechnicalDifficulty");
         }
         else
         {
             //finalScore.ModifyScoreTSP(1, 0, -1);
             GameSaveManager.StoreScore(1, 0, -1, 0);
             GameStateManager.STATE = GameStateManager.GameState.MailReading;
             SceneManager.LoadScene("MainFrame");
         }
     }
     else
     {
         CheckForPants();
     }
 }
Beispiel #5
0
    public void NextPress()
    {
        if (namingBox.text == "")
        {
            return;
        }
        int ageInteger = int.Parse(age.text);

        if (ageInteger < 2 || ageInteger > 5)
        {
            return;
        }
        if (toggleBoy.isOn == false && toggleGirl.isOn == false)
        {
            return;
        }
        if (CheckDuplicateName(namingBox.text) == true)
        {
            warning.SetActive(true);
            return;
        }
        string gender = toggleBoy.isOn ? "boy" : "girl";

        print("Register");
        UserService.register(namingBox.text, age.text, gender, "1234");
        RegisterNewPlayer(namingBox.text, ageInteger, toggleBoy.isOn ? GameSave.Sex.Boy : GameSave.Sex.Girl);
        GameSaveManager.SetNameAsActive(namingBox.text);


        PlayerPrefs.SetInt("role", 0);
        // PlayerPrefs.DeleteKey("role");


        SceneManager.LoadScene(nextSceneRemember);
    }
    private void Start()
    {
        if (gameSaveManagerInstance == null)
        {
            gameSaveManagerInstance = GameSaveManager.instance;
        }
        if (audioManagerInstance == null)
        {
            audioManagerInstance = AudioManager.instance;
        }
        fadePanelColor.r = fadePanelColor.g = fadePanelColor.b = 0;
        fadePanelColor.a = 1;
        lerpStart        = Time.time;
        audioManagerInstance.PlayMusicOneShot(MusicMenuIntro.clip, MusicMenuIntro.Volume);
        Invoke("PlayLoopMusic", MusicMenuIntro.clip.length - 0.3f);


        if (audioManagerInstance.musicVolume == 0)
        {
            musicButon.image.sprite = musicOff;
        }
        else
        {
            musicButon.image.sprite = musicOn;
        }

        if (audioManagerInstance.soundsVolume == 0)
        {
            soundsButton.image.sprite = soundsOff;
        }
        else
        {
            soundsButton.image.sprite = soundsOn;
        }
    }
Beispiel #7
0
    public void Show()
    {
        scoreText.text = ScoreAll.Score.ToString();
        this.gameObject.SetActive(true);
        Balloon.Play();


        switch (game)
        {
        case 1:
            GameSaveManager.ActiveSave.game5Score.RecordScore(ScoreAll.Score);
            break;

        case 2:
            GameSaveManager.ActiveSave.game6Score.RecordScore(ScoreAll.Score);
            break;

        case 3:
            GameSaveManager.ActiveSave.game9Score.RecordScore(ScoreAll.Score);
            Debug.Log(GameSaveManager.ActiveSave.game9Score);
            break;

        case 4:
            GameSaveManager.ActiveSave.game10Score.RecordScore(ScoreAll.Score);
            break;
        }
        // Debug.Log(GameSaveManager.ActiveSave.game6Score);

        GameSaveManager.SaveToDevice(GameSaveManager.ActiveSave);
    }
Beispiel #8
0
 private void OnApplicationQuit()
 {
     GameSaveManager.SaveInventory(playerInventory);
     GameSaveManager.SaveEquipement(HudManager.Singleton.equipmentUI);
     GameSaveManager.SaveGameProgress(gameData.gameProgress);
     GameSaveManager.SavePlayerProgress(player.stats);
 }
Beispiel #9
0
 private void Start()
 {
     gameSaveManagerInstance = GameSaveManager.instance;
     gameSaveManagerInstance.LoadGame(audioSettings);
     musicVolume  = audioSettings.musicVolume;
     soundsVolume = audioSettings.soundsVolume;
 }
Beispiel #10
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Beispiel #11
0
    public void GameSave()
    {
        GameSaveManager <MusicData> .GetInstance().SaveGame(musicData);

        GameSaveManager <ListUIData> .GetInstance().SaveGame(sceneData);

        //GameSaveManager<PartUIData>.GetInstance().SaveGame(partData);
    }
Beispiel #12
0
    private IEnumerator LoadGameSave()
    {
        yield return(new WaitForEndOfFrame());

        GameSaveManager.LoadInventory(playerInventory, gameData.itemsDataBase);
        GameSaveManager.LoadEquipment(HudManager.Singleton.equipmentUI, gameData.itemsDataBase);
        GameSaveManager.LoadPlayerProgress(player.stats);
    }
Beispiel #13
0
    public void Start()
    {
        var saves = GameSaveManager.ReadAllSaves().ToList();

        saves.Sort(new CompareByDate());
        allPlayers = saves.ToArray();

        ShowCurrentPage();
    }
    //use JSON data to generate a specific deck
    public void LoadDeck(string filepath)
    {
        //load card data object from file
        CardContainer newCards = GameSaveManager.LoadCards(filepath);

        //convert data object into card array to populate tableaus
        GameObject[] cards = GameSaveManager.loadDeck(newCards);
        //assign shuffled deck to tableaus
        for (int i = 0; i < 52; i++)
        {
            if (i >= 0 && i < 7)
            {
                tableaus[0].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[0].transform);
            }
            else if (i >= 7 && i < 14)
            {
                tableaus[1].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[1].transform);
            }
            else if (i >= 14 && i < 21)
            {
                tableaus[2].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[2].transform);
            }
            else if (i >= 21 && i < 28)
            {
                tableaus[3].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[3].transform);
            }
            else if (i >= 28 && i < 34)
            {
                tableaus[4].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[4].transform);
            }
            else if (i >= 34 && i < 40)
            {
                tableaus[5].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[5].transform);
            }
            else if (i >= 40 && i < 46)
            {
                tableaus[6].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[6].transform);
            }
            else
            {
                tableaus[7].GetComponent <CardDropArea>().cardStack.Push(cards[i]);
                cards[i].transform.SetParent(tableaus[7].transform);
            }
        }

        foreach (GameObject tableau in tableaus)
        {
            tableau.GetComponent <CardDropArea>().updateStack();
        }
    }
Beispiel #15
0
    public int GetValue(string name)
    {
        if (m_GameSaveManger == null)
        {
            m_GameSaveManger = Get <GameSaveManager>();
        }

        return(m_GameSaveManger.GetInt(name, GameSaveManager.Location.System));
    }
        public LoadGameScreen(Game game) : base("Load Game")
        {
            this.game      = game;
            Title.Position = new CPos(0, -4096, 0);

            list = new GameSaveList(4096, "wooden")
            {
                Position = new CPos(0, 1024, 0)
            };

            Add(new Button("Back", "wooden", () => game.ShowScreen(ScreenType.MENU))
            {
                Position = new CPos(4096, 6144, 0)
            });
            void loadAction()
            {
                var save = list.SelectedSave;

                if (save != null)
                {
                    humanAgreeOnLoad(() =>
                    {
                        Log.Debug($"Loading game save '{save.SaveName}'.");
                        GameController.CreateNew(save.Copy(), loadStatsMap: true);
                    }, "Are you sure you want to load this save? Unsaved progress will be lost!");
                }
            }

            Add(new Button("Load", "wooden", loadAction)
            {
                Position = new CPos(0, 6144, 0)
            });

            void deleteAction()
            {
                var save = list.SelectedSave;

                if (save != null)
                {
                    humanAgreeOnDelete(() =>
                    {
                        GameSaveManager.Delete(save);
                        game.RefreshSaveGameScreens();
                        game.ShowScreen(ScreenType.LOADGAME);
                        Log.Debug($"Deleted game save '{save.SaveName}'.");
                    }, "Are you sure you want to delete this save?");
                }
            }

            Add(new Button("Delete", "wooden", deleteAction)
            {
                Position = new CPos(-4096, 6144, 0)
            });

            Add(list);
        }
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.LogError("There can only be one instance of GameSaveManager!");
         Destroy(this);
     }
     Instance = this;
     DontDestroyOnLoad(this);
 }
Beispiel #18
0
    private void Start()
    {
        m_GameSaveManger = Get <GameSaveManager>();

        foreach (var setting in defaultSettings)
        {
            SetValue(setting.name, setting.defaultValue, false);
        }
        Messager.Send(OnSettingChangedMessage);
    }
Beispiel #19
0
    public override void OnPickup()
    {
        base.OnPickup();

        if (changeSpawnPoint >= 0 && !GameSaveManager.isLoading)
        {
            PlayerSaving.SetExitID(changeSpawnPoint);
            GameSaveManager.SaveRoom();
        }
    }
Beispiel #20
0
    internal void SaveProfile()
    {
        if (_menuUISignal != null)
        {
            _menuUISignal.Output(SandboxValue.CoinCount, _profile.Coins.ToString());
        }

        SetProfileUnlocks();
        GameSaveManager.SetObject(PROFILE_SAVE_KEY, _profile);
    }
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Home))
     {
         GameSaveManager.SaveRoom();
     }
     if (Input.GetKeyDown(KeyCode.End))
     {
         LoadingScreen.LoadRoom(GameSaveManager.currentRoom);
     }
 }
Beispiel #22
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Beispiel #23
0
 private void Start()
 {
     if (GameSaveManager.instance != null)
     {
         gameSaveManagerInstance = GameSaveManager.instance;
     }
     if (Car.instance != null)
     {
         carInstance = Car.instance;
     }
 }
Beispiel #24
0
        /// <summary>
        /// Gets invoked when the create game button gets clicked.
        /// </summary>
        public void CreateGameButtonClick()
        {
            string gameName = this.GameNameInputField.text;

            if (!LevelNameTextValidator.FullyVerifyGameName(gameName))
            {
                return;
            }
            Debug.Log("Creating new Game: " + gameName);
            GameSaveManager.LoadNewGame(gameName);
        }
Beispiel #25
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this);
 }
Beispiel #26
0
 void Awake()
 {
     // singleton pattern
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #27
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this);
     }
     DontDestroyOnLoad(this);
 }
 void Awake()
 {
     if (_gameSaveManager == null)
     {
         _gameSaveManager = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this);
 }
 private void Awake()
 {
     if (gameSave == null)
     {
         gameSave = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this);
 }
Beispiel #30
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogWarning("Only one game save manager should be in the scene!");
         Destroy(this);
     }
 }