From d5ef236e064d6e02a5fa5881fffa612f794f906f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B8=E5=AE=89404?= <101850798+YongAn404@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=BE=E7=BB=B7=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Roles/MusicManager.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Roles/MusicManager.cs b/Roles/MusicManager.cs index 95cf3c7..9fc94e7 100644 --- a/Roles/MusicManager.cs +++ b/Roles/MusicManager.cs @@ -221,8 +221,18 @@ public AudioPlayerBase Play(string musicFile, string npcName, TrackEvent trackEv return audioPlayerBase; } - //接收文件直链传递给Play处理播放(我以为要折腾,结果直接allowUrl然后复用本地文件的代码就行了,我是傻逼) - + /// + /// 播放音频Url + /// + /// 音频文件 + /// NPC名称 + /// 播放事件 + /// 传播距离检测源头玩家 + /// 额外可接收音频的玩家 + /// 是否覆盖播放 + /// 音量大小 + /// 是否Url + /// public AudioPlayerBase Play(string musicFile, string npcName, TrackEvent trackEvent, FramePlayer source, float distance, FramePlayer[] extraPlay, bool isSole = false, float volume = 80, bool isLoop = false, bool isUrl = true) { AudioPlayerBase audioPlayerBase = null; @@ -254,7 +264,6 @@ public AudioPlayerBase Play(string musicFile, string npcName, TrackEvent trackEv if (distance != 0) { - audioPlayerBase.AudioToPlay ??= []; foreach (var player in Player.List.Where(p => Vector3.Distance(p.Position, source.ExPlayer.Position) <= distance)) { audioPlayerBase.AudioToPlay.Add(player.UserId);