Пример #1
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "Player" && console.on_offSwitch == true)
     {
         SE.Stop();
     }
 }
Пример #2
0
    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;
        }
    }
Пример #3
0
 private void CancelBoostSound()
 {
     if (!Handling.IsDashing)
     {
         Boost?.Stop();
     }
 }
Пример #4
0
 private void StopParticles()
 {
     startCastingParticles.Stop();
     castingParticles.Stop();
     throwParticles.Stop();
     appearParticles.Stop();
     soundEmitter.Stop();
     playingSound = false;
 }
Пример #5
0
 public static void StopEvent(StudioEventEmitter audioEventEmitter)
 {
     if (audioEventEmitter.IsPlaying())
     {
         audioEventEmitter.Stop();
     }
 }
Пример #6
0
 void StopAudio()
 {
     if (SE.IsPlaying())
     {
         SE.Stop();
     }
 }
Пример #7
0
    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;
    }
Пример #8
0
    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();
    }
Пример #9
0
 // 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();
        }
Пример #11
0
 private void OnDisable()
 {
     if (fmodOn)
     {
         _emitter.Stop();
     }
 }
Пример #12
0
 public void PlayGameMusic()
 {
     if (menuBgm.IsPlaying())
     {
         menuBgm.Stop();
         gameBgm.Play();
     }
 }
Пример #13
0
        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;
            }
        }
Пример #14
0
 void StartVideo()
 {
     Debug.Log("START DIE VIDEO");
     DEZEOOKIGUESS.Stop();
     controller.enabled = false;
     listener.enabled   = false;
     videoParent.SetActive(true);
 }
Пример #15
0
    // 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();
        }
    }
Пример #16
0
 public void PlayMenuMusic()
 {
     if (gameBgm.IsPlaying())
     {
         gameBgm.Stop();
         menuBgm.Play();
     }
 }
Пример #17
0
 // Stops all music
 public static void StopAll()
 {
     menuEmitter.Stop();
     menuMusicPlaying = false;
     gameEmitter.Stop();
     gameMusicPlaying = false;
     gameOverEmitter.Stop();
     gameOverMusicPlaying = false;
 }
Пример #18
0
 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);
 }
Пример #20
0
 public IEnumerator TurnOffYield()
 {
     while (SceneManager.GetActiveScene().buildIndex == 0)
     {
         yield return(new WaitForSeconds(0.1f));
     }
     emitter.AllowFadeout = true;
     emitter.Stop();
 }
Пример #21
0
    // 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();
        }
    }
Пример #22
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         if (emitter)
         {
             emitter.Stop();
         }
     }
 }
Пример #23
0
    public override void Impacted()
    {
        base.Impacted();
        roamEmitter.Stop();

        if (animator != null)
        {
            animator.SetTrigger(s_DeathHash);
        }
    }
Пример #24
0
    //=======================================================================================
    //                              >  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);
        }
    }
Пример #26
0
 void StopEmitter(OnSceneLoaded pEvent)
 {
     if (GameManager.Instance.LoadedScene == SceneString.MapView)
     {
         _emitter.Stop();
     }
     else
     {
         _emitter.Play();
     }
 }
Пример #27
0
    private void CheckStatus()
    {
        if (rig.velocity.magnitude > 0f && !frictionSound.IsPlaying())
        {
            frictionSound.Play();
        }

        if (rig.velocity.magnitude <= 0f && frictionSound.IsPlaying())
        {
            frictionSound.Stop();
        }
    }
Пример #28
0
    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();
    }
Пример #29
0
        public static void ToggleEmitter(EmitterType emitterType)
        {
            StudioEventEmitter emitter = AudioManager.Instance.EventPaths.GetEmitter(emitterType);

            if (emitter.IsPlaying())
            {
                emitter.Stop();
                return;
            }

            emitter.Play();
        }
Пример #30
0
 public void ChangeSound(StudioEventEmitter emit)
 {
     if (current != emit)
     {
         if (current != null)
         {
             current.Stop();
         }
         current = emit;
         current.Play();
     }
 }