private void PlayAudio(AddressableAudioSource clipToPlay)
    {
        if (clipToPlay == null)
        {
            return;
        }

        SoundAmbientManager.StopAudio(playing);
        playing = clipToPlay;
        SoundAmbientManager.PlayAudio(clipToPlay);
    }
    private void PlayAudio(AudioClip clipToPlay)
    {
        if (clipToPlay == null)
        {
            return;
        }

        SoundAmbientManager.StopAudio(currentTrack);
        currentTrack = clipToPlay;
        SoundAmbientManager.PlayAudio(currentTrack, isLooped: true);
    }
Example #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);
            }
        }
Example #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);
            }
        }
Example #5
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);
        }
    }