From b4f99f038d5570cbc21941455e93f68d219a075c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 26 十一月 2025 17:09:13 +0800
Subject: [PATCH] 0312 增加部分基础音效 音乐

---
 Main/System/Sound/SoundPlayer.cs                  |    5 +++++
 Main/System/Settlement/BattleSettlementManager.cs |    2 ++
 Main/System/Main/HomeWin.cs                       |    3 +++
 Main/System/SystemSetting/SystemSetting.cs        |    8 ++++----
 Main/System/Battle/BaseBattleWin.cs               |   10 ++++++++++
 Main/System/KnapSack/Logic/CommonGetItemWin.cs    |    1 +
 Main/System/Battle/TianziBillboradBattleWin.cs    |    5 +++++
 Main/System/NewBieGuidance/NewBieWin.cs           |    1 +
 8 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 3df85a8..3134780 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -49,6 +49,8 @@
                 UIManager.Instance.CloseWindow<EquipExchangeWin>();
             }
         }
+
+        PlayBackGroundMusic();
     }
 
     protected override void OnPreClose()
@@ -66,6 +68,7 @@
         {
             battleField.OnRoundChange -= OnRoundChange;
         }
+        SoundPlayer.Instance.StopBackGroundMusic();
     }
 
     protected override void OnClose()
@@ -78,6 +81,7 @@
         }
         battleField = null;
     }
+
 
     /// <summary>
     /// 閫氱敤鍒锋柊閫昏緫 (妯℃澘鏂规硶)
@@ -285,4 +289,10 @@
         }
     }
 
+
+    protected virtual void PlayBackGroundMusic()
+    {
+        SoundPlayer.Instance.PlayBackGroundMusic(39);
+    }
+
 }
\ No newline at end of file
diff --git a/Main/System/Battle/TianziBillboradBattleWin.cs b/Main/System/Battle/TianziBillboradBattleWin.cs
index dbdc21a..f6d63ea 100644
--- a/Main/System/Battle/TianziBillboradBattleWin.cs
+++ b/Main/System/Battle/TianziBillboradBattleWin.cs
@@ -285,4 +285,9 @@
         return teamHeroes;
 
     }
+
+    protected override void PlayBackGroundMusic()
+    {
+        SoundPlayer.Instance.PlayBackGroundMusic(40);
+    }
 }
diff --git a/Main/System/KnapSack/Logic/CommonGetItemWin.cs b/Main/System/KnapSack/Logic/CommonGetItemWin.cs
index a2ebe00..1c97908 100644
--- a/Main/System/KnapSack/Logic/CommonGetItemWin.cs
+++ b/Main/System/KnapSack/Logic/CommonGetItemWin.cs
@@ -14,6 +14,7 @@
         ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
         scroller.OnRefreshCell += OnRefreshCell;
         CreateScroller();
+        SoundPlayer.Instance.PlayUIAudio(20);
     }
 
 
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index c6e0127..8d4edd9 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -171,6 +171,9 @@
 
         // var battleWin = UIManager.Instance.OpenWindow<BattleWin>();
         // battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
+
+        if (!SoundPlayer.Instance.IsPlayBackGroundMuisic())
+            SoundPlayer.Instance.PlayBackGroundMusic(38);
     }
 
 
diff --git a/Main/System/NewBieGuidance/NewBieWin.cs b/Main/System/NewBieGuidance/NewBieWin.cs
index 06efa85..31402bc 100644
--- a/Main/System/NewBieGuidance/NewBieWin.cs
+++ b/Main/System/NewBieGuidance/NewBieWin.cs
@@ -198,6 +198,7 @@
             m_GuideTalkRect.SetActive(false);
             DisplayGuide();
         }
+        //PlayNewBieAudio 涓嶄細琚玼i闊虫晥鎵撴柇
         SoundPlayer.Instance.PlayUIAudio(stepConfig.voice);
     }
 
diff --git a/Main/System/Settlement/BattleSettlementManager.cs b/Main/System/Settlement/BattleSettlementManager.cs
index f172857..5c8a741 100644
--- a/Main/System/Settlement/BattleSettlementManager.cs
+++ b/Main/System/Settlement/BattleSettlementManager.cs
@@ -90,6 +90,8 @@
                 }
                 break;
         }
+
+        SoundPlayer.Instance.PlayUIAudio(57);
     }
 
     //"Msg":{"itemInfo":[{"ItemID":5,"Count":2},{"ItemID":3,"Count":40}],"winFaction":1,"statInfo":{"1":{"1":{"1":{"NPCID":0,"DefHurt":727,"CureHP":0,"AtkHurt":1891,"ObjID":1,"HeroID":530004},"3":{"NPCID":0,"DefHurt":483,"CureHP":1511,"AtkHurt":782,"ObjID":6,"HeroID":520001},"2":{"NPCID":0,"DefHurt":953,"CureHP":0,"AtkHurt":1712,"ObjID":5,"HeroID":510003}}},"2":{"1":{"1":{"NPCID":10101091,"DefHurt":638,"CureHP":0,"AtkHurt":140,"ObjID":2,"HeroID":610001},"3":{"NPCID":10101092,"DefHurt":625,"CureHP":0,"AtkHurt":126,"ObjID":3,"HeroID":610001},"5":{"NPCID":10101093,"DefHurt":3122,"CureHP":0,"AtkHurt":1897,"ObjID":4,"HeroID":510003}}}}}
diff --git a/Main/System/Sound/SoundPlayer.cs b/Main/System/Sound/SoundPlayer.cs
index 85d3aee..2bbc01d 100644
--- a/Main/System/Sound/SoundPlayer.cs
+++ b/Main/System/Sound/SoundPlayer.cs
@@ -161,6 +161,11 @@
         StartCoroutine(Co_BackGroundMusicFadeOut());
     }
 
+    public bool IsPlayBackGroundMuisic()
+    {
+        return m_MusicAudioSource.isPlaying;
+    }
+
     public void UnLoadMusic(int _exclude)
     {
         if (AssetSource.isUseAssetBundle && DeviceUtility.IsLowMemory())
diff --git a/Main/System/SystemSetting/SystemSetting.cs b/Main/System/SystemSetting/SystemSetting.cs
index 077b8d4..d7dbdb2 100644
--- a/Main/System/SystemSetting/SystemSetting.cs
+++ b/Main/System/SystemSetting/SystemSetting.cs
@@ -11,8 +11,8 @@
 
 {
     const string QUALITY_LEVEL_KEY = "GameQualityLevel";
-    const string SOUND_VOLUME_KEY = "SoundRatioKey";  //闊充箰
-    const string SOUND_EFFECT_KEY = "SoundEffect"; //闊虫晥
+    const string SOUND_VOLUME_KEY = "MusicKey";  //闊充箰
+    const string SOUND_EFFECT_KEY = "SoundEffectKey"; //闊虫晥
     const string GAMEFRAME_KEY = "GameFrameSetting";//鍨傜洿鍚屾鐜�
 
     public Dictionary<SystemSwitch, bool> systemSettings = new Dictionary<SystemSwitch, bool>();
@@ -42,7 +42,7 @@
 
     public float GetSoundVolume()
     {
-        return LocalSave.GetFloat(SOUND_VOLUME_KEY, 1.0f);
+        return LocalSave.GetFloat(SOUND_VOLUME_KEY, 0.3f);
     }
 
     public void SetSoundEffect(float value)
@@ -52,7 +52,7 @@
 
     public float GetSoundEffect()
     {
-        return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1.0f);
+        return LocalSave.GetFloat(SOUND_EFFECT_KEY, 0.6f);
     }
 
     public void SetGameFps(GameFps _frame)

--
Gitblit v1.8.0