Microphones and silencers sync properly now.

This commit is contained in:
Jamie Greunbaum 2025-12-08 19:28:46 -05:00
parent b6921d760a
commit 14e8d806d2
4 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,9 @@

using System.Runtime.InteropServices;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDK3.UdonNetworkCalling;
using VRC.SDKBase;
using VRC.Udon.Common.Interfaces;
@ -111,19 +113,21 @@ public class GameManagerBase : UdonSharpBehaviour
_AllowInteractionFromHostCard = true;
EnablePlayerMicrophone(true);
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(EnablePlayerMicrophone), true);
}
public virtual void DeinitialiseGameMode()
{
EnablePlayerMicrophone(false);
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(EnablePlayerMicrophone), false);
}
[NetworkCallable]
public void EnablePlayerMicrophone(bool Enable)
{
_PlayerMicrophone.gameObject.SetActive(Enable);
}
[NetworkCallable]
public void EnableAudienceSilencer(bool Enable)
{
_AudienceSilencer.gameObject.SetActive(Enable);

View File

@ -72,7 +72,7 @@ public class GameManagerRound1 : GameManagerBase
_Modem.Activate(false);
_ArrivalDisplay.Activate(false);
EnableAudienceSilencer(true);
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(EnableAudienceSilencer), true);
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlayMusic", MusicEventType.WhereInTheWorld);
SendCustomEventDelayedSeconds(nameof(PlaySecondPartOfThemeMusic), 3.6666666666f);

View File

@ -56,7 +56,7 @@ public class GameManagerRound2 : GameManagerBase
_JailPlayer.PlayVideo = false;
EnableAudienceSilencer(true);
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(EnableAudienceSilencer), true);
RequestSerialization();
}
@ -65,6 +65,7 @@ public class GameManagerRound2 : GameManagerBase
{
_JailPlayer.PlayVideo = false;
_JailPhone.Activate = false;
_JailChain.Show = false;
base.DeinitialiseGameMode();
}

View File

@ -74,7 +74,7 @@ public class GameManagerRound3 : GameManagerBase
InitialiseMarkers();
GetCurrentMap().RandomiseCountries();
EnableAudienceSilencer(false);
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(EnableAudienceSilencer), false);
RequestSerialization();
}