// ----------------------------------------------------------------------------------- // OnStateChanged // ----------------------------------------------------------------------------------- private void OnStateChanged(GameStates state) { Time.timeScale = paused ? 0 : 1; MusicController.PlayGameStateBGM(state); if (ingame) { gameStarted = true; } }
// ------------------------------------------------------------------------------- // OnTriggerExit // ------------------------------------------------------------------------------- void OnTriggerExit(Collider co) { if (musicClip != null) { var player = co.GetComponentInParent <Player>(); if (player != null) { if (checkBGMTime(player.hitTime)) { MusicController.PlayGameStateBGM(GameStates.Game); } } } }