Пример #1
0
    private void PlayAudio(AudioClip clipToPlay)
    {
        if (clipToPlay == null)
        {
            return;
        }

        SoundAmbientManager.StopAudio(currentTrack);
        currentTrack = clipToPlay;
        SoundAmbientManager.PlayAudio(currentTrack, isLooped: true);
    }
    private void PlayAudio(AddressableAudioSource clipToPlay)
    {
        if (clipToPlay == null)
        {
            return;
        }

        SoundAmbientManager.StopAudio(playing);
        playing = clipToPlay;
        SoundAmbientManager.PlayAudio(clipToPlay);
    }
Пример #3
0
        public override void Process(NetMessage msg)
        {
            UIManager.Instance.spawnBanner.Show(msg.Name, msg.TextColor, msg.BackgroundColor);

            if (msg.PlaySound)
            {
                // make sure that all sound is disabled
                SoundAmbientManager.StopAllAudio();
                //play the spawn sound
                SoundAmbientManager.PlayAudio(msg.SpawnSound);
            }
        }
Пример #4
0
        public override void Process()
        {
            UIManager.Instance.antagBanner.Show(AntagName, TextColor, BackgroundColor);

            if (PlaySound)
            {
                // make sure that all sound is disabled
                SoundAmbientManager.StopAllAudio();
                //play the spawn sound
                SoundAmbientManager.PlayAudio(AntagSound);
            }
        }
Пример #5
0
 public void ResetDefaults()
 {
     ModalPanelManager.Instance.Confirm(
         "Are you sure?",
         () =>
     {
         UIManager.ToggleTTS(false);
         SoundAmbientManager.SetVolumeForAllAudioSources(1f);
         AudioListener.volume = 1;
         Refresh();
     },
         "Reset"
         );
 }
Пример #6
0
    public void Init()
    {
        if (isLocalPlayer)
        {
            EnableLighting(true);
            UIManager.ResetAllUI();
            GetComponent <MouseInputController>().enabled = true;

            if (!UIManager.Instance.statsTab.window.activeInHierarchy)
            {
                UIManager.Instance.statsTab.window.SetActive(true);
            }

            PlayerManager.SetPlayerForControl(gameObject, PlayerSync);

            if (IsGhost && !IsPlayerSemiGhost)
            {
                UIManager.LinkUISlots(ItemStorageLinkOrigin.adminGhost);
                //stop the crit notification and change overlay to ghost mode
                SoundManager.Stop("Critstate");
                UIManager.PlayerHealthUI.heartMonitor.overlayCrits.SetState(OverlayState.death);
                //show ghosts
                var mask = Camera2DFollow.followControl.cam.cullingMask;
                mask |= 1 << LayerMask.NameToLayer("Ghosts");
                Camera2DFollow.followControl.cam.cullingMask = mask;
            }
            else if (!IsPlayerSemiGhost)
            {
                UIManager.LinkUISlots(ItemStorageLinkOrigin.localPlayer);
                //play the spawn sound
                SoundAmbientManager.PlayAudio("ambigen8");
                //Hide ghosts
                var mask = Camera2DFollow.followControl.cam.cullingMask;
                mask &= ~(1 << LayerMask.NameToLayer("Ghosts"));
                Camera2DFollow.followControl.cam.cullingMask = mask;
            }
            else
            {
                //stop the crit notification and change overlay to ghost mode
                SoundManager.Stop("Critstate");
                UIManager.PlayerHealthUI.heartMonitor.overlayCrits.SetState(OverlayState.death);
                //show ghosts
                var mask = Camera2DFollow.followControl.cam.cullingMask;
                mask &= ~(1 << LayerMask.NameToLayer("Ghosts"));
                Camera2DFollow.followControl.cam.cullingMask = mask;
            }

            EventManager.Broadcast(EVENT.UpdateChatChannels);
        }
    }
Пример #7
0
 public void SetScreenForLobby()
 {
     SoundAmbientManager.StopAllAudio();
     MusicManager.SongTracker.StartPlayingRandomPlaylist();
     ResetUI();         //Make sure UI is back to default for next play
     UIManager.PlayerHealthUI.gameObject.SetActive(false);
     UIActionManager.Instance.OnRoundEnd();
     hudBottomHuman.SetActive(false);
     hudBottomGhost.SetActive(false);
     panelRight.gameObject.SetActive(false);
     rightClickManager.SetActive(false);
     jobSelectWindow.SetActive(false);
     teamSelectionWindow.SetActive(false);
     preRoundWindow.gameObject.SetActive(false);
     disclaimer.SetActive(true);
     UIManager.Instance.adminChatButtons.transform.parent.gameObject.SetActive(false);
 }
Пример #8
0
 public void OnAmbientVolumeChange()
 {
     SoundAmbientManager.SetVolumeForAllAudioSources(ambientSlider.value);
 }