From 652263f2a87e59b4fa55db97c24ce809a44504d6 Mon Sep 17 00:00:00 2001 From: Blank Date: Mon, 20 Jan 2025 18:08:04 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]1.=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/EventArgs/PlaySoundFailureEventArgs.cs | 2 +- Runtime/EventArgs/PlaySoundSuccessEventArgs.cs | 2 +- Runtime/EventArgs/PlaySoundUpdateEventArgs.cs | 2 +- Runtime/EventArgs/ResetSoundAgentEventArgs.cs | 2 +- Runtime/Interface.meta | 3 +++ Runtime/{Sound/Sound => Interface}/ISoundAgent.cs | 2 +- Runtime/{Sound/Sound => Interface}/ISoundAgent.cs.meta | 0 Runtime/{Sound/Sound => Interface}/ISoundAgentHelper.cs | 2 +- .../{Sound/Sound => Interface}/ISoundAgentHelper.cs.meta | 0 Runtime/{Sound/Sound => Interface}/ISoundGroup.cs | 2 +- Runtime/{Sound/Sound => Interface}/ISoundGroup.cs.meta | 0 Runtime/{Sound/Sound => Interface}/ISoundGroupHelper.cs | 2 +- .../{Sound/Sound => Interface}/ISoundGroupHelper.cs.meta | 0 Runtime/{Sound/Sound => Interface}/ISoundHelper.cs | 2 +- Runtime/{Sound/Sound => Interface}/ISoundHelper.cs.meta | 0 Runtime/{Sound/Sound => Interface}/ISoundManager.cs | 2 +- Runtime/{Sound/Sound => Interface}/ISoundManager.cs.meta | 0 Runtime/Sound/Sound/Constant.cs | 2 +- Runtime/Sound/Sound/PlaySoundErrorCode.cs | 2 +- Runtime/Sound/Sound/PlaySoundParams.cs | 5 +++-- Runtime/Sound/Sound/SoundManager.PlaySoundInfo.cs | 2 +- Runtime/Sound/Sound/SoundManager.SoundAgent.cs | 2 +- Runtime/Sound/Sound/SoundManager.SoundGroup.cs | 2 +- Runtime/Sound/Sound/SoundManager.cs | 2 +- Runtime/Sound/SoundComponent.cs | 6 +++--- 25 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 Runtime/Interface.meta rename Runtime/{Sound/Sound => Interface}/ISoundAgent.cs (99%) rename Runtime/{Sound/Sound => Interface}/ISoundAgent.cs.meta (100%) rename Runtime/{Sound/Sound => Interface}/ISoundAgentHelper.cs (99%) rename Runtime/{Sound/Sound => Interface}/ISoundAgentHelper.cs.meta (100%) rename Runtime/{Sound/Sound => Interface}/ISoundGroup.cs (98%) rename Runtime/{Sound/Sound => Interface}/ISoundGroup.cs.meta (100%) rename Runtime/{Sound/Sound => Interface}/ISoundGroupHelper.cs (92%) rename Runtime/{Sound/Sound => Interface}/ISoundGroupHelper.cs.meta (100%) rename Runtime/{Sound/Sound => Interface}/ISoundHelper.cs (94%) rename Runtime/{Sound/Sound => Interface}/ISoundHelper.cs.meta (100%) rename Runtime/{Sound/Sound => Interface}/ISoundManager.cs (99%) rename Runtime/{Sound/Sound => Interface}/ISoundManager.cs.meta (100%) diff --git a/Runtime/EventArgs/PlaySoundFailureEventArgs.cs b/Runtime/EventArgs/PlaySoundFailureEventArgs.cs index 9ee0d81..16ccf22 100644 --- a/Runtime/EventArgs/PlaySoundFailureEventArgs.cs +++ b/Runtime/EventArgs/PlaySoundFailureEventArgs.cs @@ -8,7 +8,7 @@ using GameFrameX.Event.Runtime; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 播放声音失败事件。 diff --git a/Runtime/EventArgs/PlaySoundSuccessEventArgs.cs b/Runtime/EventArgs/PlaySoundSuccessEventArgs.cs index 850e5ce..2fdb3e8 100644 --- a/Runtime/EventArgs/PlaySoundSuccessEventArgs.cs +++ b/Runtime/EventArgs/PlaySoundSuccessEventArgs.cs @@ -8,7 +8,7 @@ using GameFrameX.Event.Runtime; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 播放声音成功事件。 diff --git a/Runtime/EventArgs/PlaySoundUpdateEventArgs.cs b/Runtime/EventArgs/PlaySoundUpdateEventArgs.cs index 0b60a7d..90f88df 100644 --- a/Runtime/EventArgs/PlaySoundUpdateEventArgs.cs +++ b/Runtime/EventArgs/PlaySoundUpdateEventArgs.cs @@ -8,7 +8,7 @@ using GameFrameX.Event.Runtime; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 播放声音更新事件。 diff --git a/Runtime/EventArgs/ResetSoundAgentEventArgs.cs b/Runtime/EventArgs/ResetSoundAgentEventArgs.cs index 157c1ec..a8d0514 100644 --- a/Runtime/EventArgs/ResetSoundAgentEventArgs.cs +++ b/Runtime/EventArgs/ResetSoundAgentEventArgs.cs @@ -8,7 +8,7 @@ using GameFrameX.Event.Runtime; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 重置声音代理事件。 diff --git a/Runtime/Interface.meta b/Runtime/Interface.meta new file mode 100644 index 0000000..6ea0cd5 --- /dev/null +++ b/Runtime/Interface.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: aff46902d1a24748aaca415c05ae8a0f +timeCreated: 1737367083 \ No newline at end of file diff --git a/Runtime/Sound/Sound/ISoundAgent.cs b/Runtime/Interface/ISoundAgent.cs similarity index 99% rename from Runtime/Sound/Sound/ISoundAgent.cs rename to Runtime/Interface/ISoundAgent.cs index 835ebff..242c0a7 100644 --- a/Runtime/Sound/Sound/ISoundAgent.cs +++ b/Runtime/Interface/ISoundAgent.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音代理接口。 diff --git a/Runtime/Sound/Sound/ISoundAgent.cs.meta b/Runtime/Interface/ISoundAgent.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundAgent.cs.meta rename to Runtime/Interface/ISoundAgent.cs.meta diff --git a/Runtime/Sound/Sound/ISoundAgentHelper.cs b/Runtime/Interface/ISoundAgentHelper.cs similarity index 99% rename from Runtime/Sound/Sound/ISoundAgentHelper.cs rename to Runtime/Interface/ISoundAgentHelper.cs index 08ffe05..4fe3ce2 100644 --- a/Runtime/Sound/Sound/ISoundAgentHelper.cs +++ b/Runtime/Interface/ISoundAgentHelper.cs @@ -7,7 +7,7 @@ using System; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音代理辅助器接口。 diff --git a/Runtime/Sound/Sound/ISoundAgentHelper.cs.meta b/Runtime/Interface/ISoundAgentHelper.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundAgentHelper.cs.meta rename to Runtime/Interface/ISoundAgentHelper.cs.meta diff --git a/Runtime/Sound/Sound/ISoundGroup.cs b/Runtime/Interface/ISoundGroup.cs similarity index 98% rename from Runtime/Sound/Sound/ISoundGroup.cs rename to Runtime/Interface/ISoundGroup.cs index 34b21b9..61f5765 100644 --- a/Runtime/Sound/Sound/ISoundGroup.cs +++ b/Runtime/Interface/ISoundGroup.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音组接口。 diff --git a/Runtime/Sound/Sound/ISoundGroup.cs.meta b/Runtime/Interface/ISoundGroup.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundGroup.cs.meta rename to Runtime/Interface/ISoundGroup.cs.meta diff --git a/Runtime/Sound/Sound/ISoundGroupHelper.cs b/Runtime/Interface/ISoundGroupHelper.cs similarity index 92% rename from Runtime/Sound/Sound/ISoundGroupHelper.cs rename to Runtime/Interface/ISoundGroupHelper.cs index 4ad6bdf..d415aee 100644 --- a/Runtime/Sound/Sound/ISoundGroupHelper.cs +++ b/Runtime/Interface/ISoundGroupHelper.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音组辅助器接口。 diff --git a/Runtime/Sound/Sound/ISoundGroupHelper.cs.meta b/Runtime/Interface/ISoundGroupHelper.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundGroupHelper.cs.meta rename to Runtime/Interface/ISoundGroupHelper.cs.meta diff --git a/Runtime/Sound/Sound/ISoundHelper.cs b/Runtime/Interface/ISoundHelper.cs similarity index 94% rename from Runtime/Sound/Sound/ISoundHelper.cs rename to Runtime/Interface/ISoundHelper.cs index b15770f..a96f896 100644 --- a/Runtime/Sound/Sound/ISoundHelper.cs +++ b/Runtime/Interface/ISoundHelper.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音辅助器接口。 diff --git a/Runtime/Sound/Sound/ISoundHelper.cs.meta b/Runtime/Interface/ISoundHelper.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundHelper.cs.meta rename to Runtime/Interface/ISoundHelper.cs.meta diff --git a/Runtime/Sound/Sound/ISoundManager.cs b/Runtime/Interface/ISoundManager.cs similarity index 99% rename from Runtime/Sound/Sound/ISoundManager.cs rename to Runtime/Interface/ISoundManager.cs index 3f7dc8f..9b42e8d 100644 --- a/Runtime/Sound/Sound/ISoundManager.cs +++ b/Runtime/Interface/ISoundManager.cs @@ -10,7 +10,7 @@ using Cysharp.Threading.Tasks; using GameFrameX.Asset.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音管理器接口。 diff --git a/Runtime/Sound/Sound/ISoundManager.cs.meta b/Runtime/Interface/ISoundManager.cs.meta similarity index 100% rename from Runtime/Sound/Sound/ISoundManager.cs.meta rename to Runtime/Interface/ISoundManager.cs.meta diff --git a/Runtime/Sound/Sound/Constant.cs b/Runtime/Sound/Sound/Constant.cs index c4a6ca4..0d55994 100644 --- a/Runtime/Sound/Sound/Constant.cs +++ b/Runtime/Sound/Sound/Constant.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音相关常量。 diff --git a/Runtime/Sound/Sound/PlaySoundErrorCode.cs b/Runtime/Sound/Sound/PlaySoundErrorCode.cs index d892a7f..f32295d 100644 --- a/Runtime/Sound/Sound/PlaySoundErrorCode.cs +++ b/Runtime/Sound/Sound/PlaySoundErrorCode.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 播放声音错误码。 diff --git a/Runtime/Sound/Sound/PlaySoundParams.cs b/Runtime/Sound/Sound/PlaySoundParams.cs index bcffc95..6974c3a 100644 --- a/Runtime/Sound/Sound/PlaySoundParams.cs +++ b/Runtime/Sound/Sound/PlaySoundParams.cs @@ -7,7 +7,7 @@ using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 播放声音参数。 @@ -223,10 +223,11 @@ internal bool Referenced /// 创建播放声音参数。 /// /// 创建的播放声音参数。 - public static PlaySoundParams Create() + public static PlaySoundParams Create(bool isLoop =false) { PlaySoundParams playSoundParams = ReferencePool.Acquire(); playSoundParams.m_Referenced = true; + playSoundParams.m_Loop = isLoop; return playSoundParams; } diff --git a/Runtime/Sound/Sound/SoundManager.PlaySoundInfo.cs b/Runtime/Sound/Sound/SoundManager.PlaySoundInfo.cs index cf540f6..0ffbeeb 100644 --- a/Runtime/Sound/Sound/SoundManager.PlaySoundInfo.cs +++ b/Runtime/Sound/Sound/SoundManager.PlaySoundInfo.cs @@ -7,7 +7,7 @@ using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { public sealed partial class SoundManager : GameFrameworkModule, ISoundManager { diff --git a/Runtime/Sound/Sound/SoundManager.SoundAgent.cs b/Runtime/Sound/Sound/SoundManager.SoundAgent.cs index b54dee5..5af8701 100644 --- a/Runtime/Sound/Sound/SoundManager.SoundAgent.cs +++ b/Runtime/Sound/Sound/SoundManager.SoundAgent.cs @@ -8,7 +8,7 @@ using System; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { public sealed partial class SoundManager : GameFrameworkModule, ISoundManager { diff --git a/Runtime/Sound/Sound/SoundManager.SoundGroup.cs b/Runtime/Sound/Sound/SoundManager.SoundGroup.cs index c3aea8c..d6d322b 100644 --- a/Runtime/Sound/Sound/SoundManager.SoundGroup.cs +++ b/Runtime/Sound/Sound/SoundManager.SoundGroup.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using GameFrameX.Runtime; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { public sealed partial class SoundManager : GameFrameworkModule, ISoundManager { diff --git a/Runtime/Sound/Sound/SoundManager.cs b/Runtime/Sound/Sound/SoundManager.cs index e3d52fd..3b17ba7 100644 --- a/Runtime/Sound/Sound/SoundManager.cs +++ b/Runtime/Sound/Sound/SoundManager.cs @@ -13,7 +13,7 @@ using UnityEngine; using YooAsset; -namespace GameFrameX.Sound +namespace GameFrameX.Sound.Runtime { /// /// 声音管理器。 diff --git a/Runtime/Sound/SoundComponent.cs b/Runtime/Sound/SoundComponent.cs index 05214f4..59380ba 100644 --- a/Runtime/Sound/SoundComponent.cs +++ b/Runtime/Sound/SoundComponent.cs @@ -605,7 +605,7 @@ private bool AddSoundAgentHelper(string soundGroupName, SoundGroupHelperBase sou return true; } - private void OnPlaySoundSuccess(object sender, GameFrameX.Sound.PlaySoundSuccessEventArgs eventArgs) + private void OnPlaySoundSuccess(object sender, PlaySoundSuccessEventArgs eventArgs) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)eventArgs.UserData; if (playSoundInfo != null) @@ -624,7 +624,7 @@ private void OnPlaySoundSuccess(object sender, GameFrameX.Sound.PlaySoundSuccess m_EventComponent.Fire(this, eventArgs); } - private void OnPlaySoundFailure(object sender, GameFrameX.Sound.PlaySoundFailureEventArgs eventArgs) + private void OnPlaySoundFailure(object sender, PlaySoundFailureEventArgs eventArgs) { string logMessage = Utility.Text.Format("Play sound failure, asset name '{0}', sound group name '{1}', error code '{2}', error message '{3}'.", eventArgs.SoundAssetName, eventArgs.SoundGroupName, eventArgs.ErrorCode, eventArgs.ErrorMessage); @@ -640,7 +640,7 @@ private void OnPlaySoundFailure(object sender, GameFrameX.Sound.PlaySoundFailure m_EventComponent.Fire(this, eventArgs); } - private void OnPlaySoundUpdate(object sender, GameFrameX.Sound.PlaySoundUpdateEventArgs eventArgs) + private void OnPlaySoundUpdate(object sender, PlaySoundUpdateEventArgs eventArgs) { m_EventComponent.Fire(this, eventArgs); }