/// <summary> /// Load game from "save/game" directory /// GuiManager must started first /// </summary> public static void LoadGame(bool isInitlizeGame) { if (isInitlizeGame) { //Clear ScriptManager.Clear(); ScriptExecuter.Init(); MagicManager.Clear(); NpcManager.ClearAllNpc(); ObjManager.ClearAllObjAndFileName(); Globals.TheMap.Free(); GuiManager.CloseTimeLimit(); GuiManager.EndDialog(); BackgroundMusic.Stop(); Globals.IsInputDisabled = false; } LoadGameFile(); LoadMagicGoodMemoList(); LoadPlayer(); //Apply xiulian magic to player Globals.ThePlayer.XiuLianMagic = MagicListManager.GetItemInfo( MagicListManager.XiuLianIndex); LoadPartner(); LoadTraps(); LoadTrapIgnoreList(); Globals.TheCarmera.CenterPlayerInCamera(); GameState.State = GameState.StateType.Playing; Globals.TheGame.IsGamePlayPaused = false; GuiManager.ShowAllPanels(false); }
public void ShowNextSection() { if (levelCount == 1) { Level1Player.GetComponent <PlayerMovement>().MovementEnabled = false; Level1Player.GetComponent <Rigidbody>().isKinematic = true; SwitchSound.Play(); Level2.SetActive(true); Level2Player.GetComponent <PlayerMovement>().MovementEnabled = true; levelCount++; } else if (levelCount == 2) { Level2Player.GetComponent <PlayerMovement>().MovementEnabled = false; SwitchSound.Play(); Level3.SetActive(true); Level3Player.GetComponent <PlayerMovement>().MovementEnabled = true; levelCount++; } else { BaseCam.SetActive(true); BackgroundMusic.Stop(); SceneManager.LoadScene("ZiedNextLevel", LoadSceneMode.Single); } }
public static void Begin_Clicked(object sender, EventArgs e) { EnabledSwitch(Form1.LeftField.CellField, false); if (MouseEvent.BeginArround) { MouseEvent.EndedArround(); } BackgroundMusic.Stop(); EndedGame = false; BeginGame(null, EventArgs.Empty); leftPlayer = Form1.LeftPlayer; rightPlayer = Form1.RightPlayer; Side OneMove = (Side)random.Next(0, 2); if (OneMove == Side.Right) { Transfer_Move(leftPlayer, EventArgs.Empty); } else { Transfer_Move(rightPlayer, EventArgs.Empty); } EnabledSwitch(Form1.RightField.CellField, true); }
void OnEpisodeCompleted() { if (currentCharacter) { currentCharacter.Hide(); } if (currentDialog) { currentDialog.Hide(); } BackgroundMusic.Stop(); StartCoroutine(GUI.Fade(background, 1f, 0f, FADE_TIME, Quit)); }
public static void Ok_Clicked(object sender, EventArgs e) { BeforeGame(null, EventArgs.Empty); EnabledSwitch(Form1.LeftField.CellField, true); foreach (var value in Form1.RightField.CellField) { value.RenderingMode = CellCondition.Empty; } Form1.LeftField.RandomShips.RandomArrangement(); Form1.LeftField.DisplayCompletionCell(); Form1.RightField.RandomShips.RandomArrangement(); resetStatistika(rightStatistika); resetStatistika(leftStatistika); BackgroundMusic.Stop(); PlaysSound(BeforeSound); }
//Stop sound public void StopSound(string sound) { //Check given sound name matches and soundIDs for (int i = 0; i < soundFx.Length; i++) { if (sound == soundFx[i].soundID) { soundFx[i].Stop(); return; } } Debug.LogWarning("SoundManager: Requested sound was not found"); if (sound == music.soundID) { music.Stop(); } else { //Throw warning if sound wasn't found Debug.LogWarning("SoundManager: Requested sound was not found"); } }
public override void Leave() { bgm.Stop(); }
public void PlayGame() { backgroundMusic.Stop(); SceneManager.LoadScene(7); }
public void GoToLevel() { backgroundMusic.Stop(); SceneManager.LoadScene(6 + level); }
void RefreshCurrentSpeech() { isChangingSpeech = true; isCharacterChanged = PreviousSpeech == null || (PreviousSpeech != null && !PreviousSpeech.character.Equals(CurrentSpeech.character)); isBackgroundChanged = !string.IsNullOrEmpty(CurrentSpeech.background); if (currentCharacter && (isCharacterChanged || isBackgroundChanged)) { currentCharacter.Hide(); } if (isCharacterChanged) { if (!Assets.CHARACTER_NARRATOR.Equals(CurrentSpeech.character)) { currentCharacter = GetCharacter(CurrentSpeech.character); } else { currentCharacter = null; } } // Hide current dialog anyway. If speaking character not changed, dialog will be shown up with a small delay if (currentDialog) { currentDialog.Hide(); } if (isBackgroundChanged) { if (PreviousSpeech == null) { StartCoroutine(ShowBackground(Assets.Load <Sprite>(Assets.BACKGROUND, CurrentSpeech.background))); } else { StartCoroutine(UpdateBackground(Assets.Load <Sprite>(Assets.BACKGROUND, CurrentSpeech.background))); } } else if (isCharacterChanged) { Invoke("OnBackgroundUpdated", CHANGE_CHARACTER_DELAY); } else { OnBackgroundUpdated(); } if (!string.IsNullOrEmpty(CurrentSpeech.music)) { if (Assets.MUSIC_OFF.Equals(CurrentSpeech.music)) { BackgroundMusic.Stop(); } else { BackgroundMusic.Play(Assets.Load <AudioClip>(Assets.MUSIC, CurrentSpeech.music)); } } }