private void Awake() { Instance = this; if (Game.current == null) //If this isn't on a save file. { Game.current = new Game(); //Creates new default save file. } if (GameOptions.current == null) //If there's no saved game options. { OptionsSaveLoad.LoadSettings(); } if (testingSaves) { Game.current.Progress.Level1[0] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level1[1] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level1[2] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level2[0] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level2[1] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level2[2] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level3[0] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level3[1] = Player_States.LevelCompletion.Cleared; Game.current.Progress.Level3[2] = Player_States.LevelCompletion.Cleared; Game.current.Progress.FinalBoss = Player_States.LevelCompletion.Cleared; Game.current.Progress.Sword1 = Player_States.SwordsObtainedStatus.Ignored; Game.current.Progress.Sword2 = Player_States.SwordsObtainedStatus.Ignored; } CheckingOutfits = false; }
void ToStageSelect() { Time.timeScale = 1; Game.current.Progress.GameplayPaused = false; OptionsSaveLoad.SaveSettings(); SaveAndLoad.Save(Game.current.Progress.FileNumber); SceneManager.LoadScene("StageSelect"); }
void QuitToTitleScreen() { Time.timeScale = 1; OptionsSaveLoad.SaveSettings(); Game.current.Progress.GameplayPaused = false; SaveAndLoad.Save(Game.current.Progress.FileNumber); SceneManager.LoadScene("_TitleScreen"); }
private void Awake() { LoadAvailable = false; if (GameOptions.current == null) //If there's no saved game options. { Debug.Log("New Options Started"); OptionsSaveLoad.LoadSettings(); //Creates a new default game options. } else { Debug.Log("Options Exist"); } }
private void Awake() { RespawnSFXCanPlay = false; Instance = this; //Sets the current instance of the script to this current gameobject in the scene. if (Game.current == null) //If this isn't on a save file. { Game.current = new Game(); //Creates new default save file. } if (GameOptions.current == null) //If there's no saved game options. { OptionsSaveLoad.LoadSettings(); } }
// Update is called once per frame void Update() { Time.timeScale = 1; waitingHappened -= Time.deltaTime; if (waitingHappened <= 0) { switch (SequenceNumber) { case 0: myAudioSource.Play(); Message1ReturnToOld = Message1.GetComponent <Text>().text; SequenceNumber = 1; waitingHappened = waitTime; MessageBackdrop.SetActive(true); Message1.SetActive(true); break; case 1: myAudioSource.Stop(); SequenceNumber = 2; waitingHappened = waitTime * 2; Message1.GetComponent <Text>().text += "."; break; case 2: SequenceNumber = 3; waitingHappened = waitTime; Message1.GetComponent <Text>().text += "."; OptionsSaveLoad.LoadSettings(true); break; case 3: if (OptionsSaveLoad.OptionsSaveExists) { SequenceNumber = 5; waitingHappened = waitTime; Message1.GetComponent <Text>().text += "."; //OptionsSaveLoad.LoadSettings(true); } else { SequenceNumber = 4; waitingHappened = waitTime * 2; Message1.GetComponent <Text>().text = Message1Error; myAudioSource.Play(); GameOptions.current = new GameOptions(); } break; case 4: //myAudioSource.Stop(); SequenceNumber = 5; waitingHappened = waitTime; Message1.GetComponent <Text>().text = Message1ReturnToOld + ".."; OptionsSaveLoad.SaveSettings(); break; case 5: //myAudioSource.Stop(); SequenceNumber = 6; waitingHappened = waitTime * 2; Message1.GetComponent <Text>().text = Message1ReturnToOld + "..."; break; case 6: SequenceNumber = 7; waitingHappened = waitTime; Message1.SetActive(false); MessageBackdrop.SetActive(false); break; case 7: myAudioSource.Play(); SequenceNumber = 8; waitingHappened = waitTime; MessageBackdrop.SetActive(true); Message2.SetActive(true); break; case 8: //myAudioSource.Stop(); SequenceNumber = 9; waitingHappened = waitTime; Message2.SetActive(false); MessageBackdrop.SetActive(false); break; case 9: SceneManager.LoadScene(NextSceneNameHere); break; } } }
void Start() { VolumeSliderCurrentlySelected = 0; bool LoadAvailable; GraphicsMenuResolutionOptions = 0; OptionsSaveLoad.LoadSettings(); switch (OptionsSaveLoad.OptionsSaveExists) { case true: LoadAvailable = true; break; case false: LoadAvailable = false; break; default: LoadAvailable = false; break; } ExistingOptions = LoadAvailable; if (!ExistingOptions) { GameOptions.current = new GameOptions(); } OptionsSaveLoad.SaveSettings(); Controls = PlayerController.CreateWithDefaultBindings(); //Selection2 = false; //ControlsListOpen = false; MenuIsOpen = false; move = 0; buttonPressTime = 0; //Debug.Log("Last Device Style: " + Controls.LastDeviceStyle); string LastDeviceUsed = Controls.LastDeviceStyle.ToString(); string LastCheckDeviceUsed = LastDeviceUsed; GraphicsMenuObj.SetActive(false); ControllsMenuObj.SetActive(false); VolumeMenuObj.SetActive(false); ReopenRegularMenu(); //Debug.Log (InputDeviceStyle.PlayStation4.ToString()); switch (LastDeviceUsed) { default: DisplayButtonsTypes(0); break; case "PlayStation4": DisplayButtonsTypes(1); break; case "XboxOne": DisplayButtonsTypes(2); break; } //selected = false; MenuNav = OptionsMenuNavigation.Graphics; OptionsOpen = OptionsMenuNavigation.None; buttonPressTime = buttonPressReset; SelectionTimer = SelectionBuffer; GraphicsMenuSelectionNumber = 0; foreach (AudioSource sourceToBeSetDeactiveHere in VolumeTestSources) { sourceToBeSetDeactiveHere.gameObject.SetActive(false); } }
void QuitToTitleScreen() { OptionsSaveLoad.SaveSettings(); SceneManager.LoadScene("_TitleScreen"); }