2022-08-27 17:04:15 -04:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
|
|
|
|
namespace QSB.Audio.Messages;
|
|
|
|
|
|
|
|
|
|
|
2022-08-27 19:10:20 -04:00
|
|
|
|
public class PlayerAudioControllerOneShotMessage : QSBMessage<(AudioType audioType, uint userID, float pitch, float volume)>
|
2022-08-27 17:04:15 -04:00
|
|
|
|
{
|
2022-08-27 19:10:20 -04:00
|
|
|
|
public PlayerAudioControllerOneShotMessage(AudioType audioType, uint userID, float pitch = 1f, float volume = 1f) : base((audioType, userID, pitch, volume)) { }
|
2022-08-27 17:04:15 -04:00
|
|
|
|
|
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote() =>
|
2022-08-27 19:10:20 -04:00
|
|
|
|
QSBPlayerManager.GetPlayer(Data.userID)?.AudioController?.PlayOneShot(Data.audioType, Data.pitch, Data.volume);
|
2022-08-27 17:04:15 -04:00
|
|
|
|
}
|