void OnTriggerExit2D(Collider2D other) { if (other.tag == "Player" && console.on_offSwitch == true) { SE.Stop(); } }
public void PlayerMovementState(string state) { if (!(state == "Run" || state == "Walk" || state == "Sneak")) { return; } if (this.state == state) { return; } this.state = state; playerMove.Stop(); switch (state) { case "Walk": playerMove = playerWalk; break; case "Run": playerMove = playerRun; break; case "Sneak": playerMove = playerSneak; break; } }
private void CancelBoostSound() { if (!Handling.IsDashing) { Boost?.Stop(); } }
private void StopParticles() { startCastingParticles.Stop(); castingParticles.Stop(); throwParticles.Stop(); appearParticles.Stop(); soundEmitter.Stop(); playingSound = false; }
public static void StopEvent(StudioEventEmitter audioEventEmitter) { if (audioEventEmitter.IsPlaying()) { audioEventEmitter.Stop(); } }
void StopAudio() { if (SE.IsPlaying()) { SE.Stop(); } }
void Start() { targetZoomLevel = zoomedOutDistance; _currentCamera = Camera.main; JunkerGameMode.instance.cameraManager = this; SceneLoader.instance.OnChangeLevel += (E_Level currentLevel, E_Level p_NextLevel) => { musicComponent.Stop(); }; var levelData = SceneLoader.instance.FindLevelData(SceneLoader.instance.currentLevel); if (levelData == null) { return; } musicComponent.Event = levelData.levelMusic; musicComponent.Play(); _currentCamera.DOShakeRotation(1000f, 0.08f, 1, 80f, false).SetLoops(-1).SetEase(Ease.InOutCubic); var state = JunkerGameMode.junkerState; musicXComplete = state.x_Recovered ? 1f : 0f; musicYComplete = state.y_Recovered ? 1f : 0f; musicZComplete = state.z_Recovered ? 1f : 0f; }
public void PlayLevelMusic() { //This switch looks at the last loadedLevel number using the scene index in build settings to decide which music clip to play. switch (SceneManager.GetActiveScene().buildIndex) { //If scene index is 0 (usually title scene) assign the clip titleMusic to musicSource case 0: musicSource.clip = menuSettings.mainMenuMusicLoop; fmodMusicSource.Play(); break; //If scene index is 1 (usually main scene) assign the clip mainMusic to musicSource case 2: Debug.Log("Scene index is 1, setting music to " + menuSettings.musicLoopToChangeTo); musicSource.clip = menuSettings.musicLoopToChangeTo; fmodMusicSource.Stop(); break; } //Fade up the volume very quickly, over resetTime seconds (.01 by default) FadeUp(resetTime); //Play the assigned music clip in musicSource musicSource.Play(); }
// Update is called once per frame void Update() { if (SK_UIController.Instance.IsGameOver) { portalAudio.Stop(); } }
public void StopAllEmitter() { GameObject[] l3DEmitterArray = GameObject.FindGameObjectsWithTag("3DEmitter"); StudioEventEmitter lEmitter; int lLength = _emitterArray.Length; int lIndex; for (lIndex = lLength - 1; lIndex >= 0; lIndex--) { lEmitter = _emitterArray[lIndex]; lEmitter.Stop(); } lLength = l3DEmitterArray.Length; for (lIndex = lLength - 1; lIndex >= 0; lIndex--) { Destroy(l3DEmitterArray[lIndex]); } SwitchSnapshot(null); _musicEmitter.Stop(); _cloudInEmitter.Stop(); _cloudOutEmitter.Stop(); }
private void OnDisable() { if (fmodOn) { _emitter.Stop(); } }
public void PlayGameMusic() { if (menuBgm.IsPlaying()) { menuBgm.Stop(); gameBgm.Play(); } }
private void StopLaserCuttingFX() { sfx_laserLoop.Stop(); if (playerIKTarget != null) { playerIKTarget.enabled = true; } if (fxControl != null && this.fxIsPlaying) { fxControl.StopAndDestroy(0f); fxIsPlaying = false; CancelInvoke("RandomizeIntensity"); fxLight.enabled = false; } }
void StartVideo() { Debug.Log("START DIE VIDEO"); DEZEOOKIGUESS.Stop(); controller.enabled = false; listener.enabled = false; videoParent.SetActive(true); }
// Update the timer and UI private void Update() { if (!TimerStarted) { return; } if (TimeLeft > 0) { TimeLeft -= Time.deltaTime; // Reduce time // Update UI if (timerUI != null) { timerUI.fillAmount = TimeLeft / MaxTime; } // If time is less than the required threshold we start pulsing red if (TimeLeft < pulseThreshold) { pulseState += Time.deltaTime * pulseDir * pulseSpeed; // Simple switch to change the direction of lerp if (pulseState > 1) { pulseDir = -1; } if (pulseState < 0) { pulseDir = 1; } TimerUI.color = Color.Lerp(Color.white, Color.red, pulseState); // Lerp between white and red if (!eventIsPlaying) { timeOutEmitter.Play(); eventIsPlaying = true; } } } else // Start game over scene { TimerStarted = false; GameMenu.LoadGameOverScene(); MusicManager.PlayGameOverTrack(); timeOutEmitter.Stop(); } }
public void PlayMenuMusic() { if (gameBgm.IsPlaying()) { gameBgm.Stop(); menuBgm.Play(); } }
// Stops all music public static void StopAll() { menuEmitter.Stop(); menuMusicPlaying = false; gameEmitter.Stop(); gameMusicPlaying = false; gameOverEmitter.Stop(); gameOverMusicPlaying = false; }
public void MonsterStopsChasing() { chasingMonster--; if (chasingMonster == 0) { BackgroundMusic.Play(); MonsterChaseMusic.Stop(); } }
private void FixedUpdate() { if (GameManager.instance.gameOver) { windEvent.Stop(); return; } windEvent.SetParameter("Velocity", playerRigid.velocity.magnitude / maxVelocitySpeed); }
public IEnumerator TurnOffYield() { while (SceneManager.GetActiveScene().buildIndex == 0) { yield return(new WaitForSeconds(0.1f)); } emitter.AllowFadeout = true; emitter.Stop(); }
// private void Start() // { // MusicToFadeIn = GameObject.Find( FadeIn ).GetComponent<StudioEventEmitter>(); // MusicToFadeIn = GameObject.Find( FadeOut ).GetComponent<StudioEventEmitter>(); // } // private void OnEnable() // { // MusicToFadeIn = GameObject.Find( FadeIn ).GetComponent<StudioEventEmitter>(); // MusicToFadeIn = GameObject.Find( FadeOut ).GetComponent<StudioEventEmitter>(); // } private void OnTriggerEnter(Collider other) { MusicToFadeIn = GameObject.Find(FadeIn).GetComponent <StudioEventEmitter>(); MusicToFadeOut = GameObject.Find(FadeOut).GetComponent <StudioEventEmitter>(); if (other.tag.Equals("Player")) { MusicToFadeOut.Stop(); MusicToFadeIn.Play(); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { if (emitter) { emitter.Stop(); } } }
public override void Impacted() { base.Impacted(); roamEmitter.Stop(); if (animator != null) { animator.SetTrigger(s_DeathHash); } }
//======================================================================================= // > Update Functions < //======================================================================================= //-----------------------------------UseLever----------------------------------------- /// <summary> Increases the levers count and destroys the lever object after playing the use lever sound. </summary> private void UseLever(Collision collision) { if (collision.gameObject.tag == "Player" && (Input.GetKeyDown(KeyCode.E) || tapScreenScript.isTapping)) { attractionNoise.Stop(); // stops the loops sound useSound.Play(); // plays the use sound Player.levers++; // increases the levers count Destroy(GetComponent <BoxCollider>()); // destroys the box collider Destroy(this.gameObject, _soundLength); // destroys the object after the sound is done playing } }
public override void Impacted() { m_isMoving = false; base.Impacted(); patrolEmitter.Stop(); if (animator != null) { animator.SetTrigger(s_DeadHash); } }
void StopEmitter(OnSceneLoaded pEvent) { if (GameManager.Instance.LoadedScene == SceneString.MapView) { _emitter.Stop(); } else { _emitter.Play(); } }
private void CheckStatus() { if (rig.velocity.magnitude > 0f && !frictionSound.IsPlaying()) { frictionSound.Play(); } if (rig.velocity.magnitude <= 0f && frictionSound.IsPlaying()) { frictionSound.Stop(); } }
IEnumerator Audio(GameObject f) { SE.Play(); yield return(new WaitForSeconds(5)); Phone phone; phone = GameObject.FindWithTag("Player").GetComponent <Phone>(); phone.spawnFriend = f; phone.SpawnFriend(); SE.Stop(); }
public static void ToggleEmitter(EmitterType emitterType) { StudioEventEmitter emitter = AudioManager.Instance.EventPaths.GetEmitter(emitterType); if (emitter.IsPlaying()) { emitter.Stop(); return; } emitter.Play(); }
public void ChangeSound(StudioEventEmitter emit) { if (current != emit) { if (current != null) { current.Stop(); } current = emit; current.Play(); } }