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

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

        if (rig.velocity.magnitude <= 0f && frictionSound.IsPlaying())
        {
            frictionSound.Stop();
        }
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 29
0
        public static void ToggleEmitter(EmitterType emitterType)
        {
            StudioEventEmitter emitter = AudioManager.Instance.EventPaths.GetEmitter(emitterType);

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

            emitter.Play();
        }
Ejemplo n.º 30
0
 public void ChangeSound(StudioEventEmitter emit)
 {
     if (current != emit)
     {
         if (current != null)
         {
             current.Stop();
         }
         current = emit;
         current.Play();
     }
 }