Browse Source

1.水果弹夹问题修改:打水果的子弹,在新开一局游戏时,要更新为满弹的状态;目前是记忆上一次游戏结束时的子弹数;会出现换弹提示一直关不掉的情况;打水果时,当没有子弹时,换弹提示就让它一直出现,直到换弹完成;目前是换弹提示三秒后会消失;
2.选关界面校准界面:修改成不弹出,计时按实际时间计时=>当在选关界面或结算界面,用按键唤出准心校正的界面时,会发生冲突,准心校正的时间不会倒计时
3.音效功能中,移动靶,水果,塔防的音效没有控制
4.生日设置的窗口调整;

slambb 8 months ago
parent
commit
08fac95881
26 changed files with 202 additions and 53 deletions
  1. 1 1
      Assets/BowArrow/DoubleScene/Scripts/AutoResetViewNew.cs
  2. 3 0
      Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/cn.json
  3. 3 0
      Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/en.json
  4. 4 1
      Assets/BowArrow/Scripts/Expand/AutoResetView.cs
  5. 2 2
      Assets/FruitMaster/Scripts/AudioManager.cs
  6. 1 1
      Assets/FruitMaster/Scripts/CannonController.cs
  7. 1 1
      Assets/FruitMaster/Scripts/ComboPomegaranteBehavior.cs
  8. 1 1
      Assets/FruitMaster/Scripts/FruitBehavior.cs
  9. 12 5
      Assets/FruitMaster/Scripts/GamingManager.cs
  10. 12 4
      Assets/Game_Hyperspace/Script/GeneratingTarget.cs
  11. 4 1
      Assets/Game_Hyperspace/Script/SpineAnimationLoader.cs
  12. 1 1
      Assets/SmartBow/Resources/SmartBow/Prefabs/Views/GameResultView.prefab
  13. 33 0
      Assets/SmartBow/Resources/SmartBow/Prefabs/Views/Home/PersonalView.prefab
  14. 49 9
      Assets/SmartBow/Scripts/Common/BulletManager.cs
  15. 42 3
      Assets/SmartBow/Scripts/Common/TipBulletNumber.cs
  16. 5 2
      Assets/SmartBow/Scripts/Views/PersonalViewParts/BoxUserSettings.cs
  17. 4 3
      Assets/ThirdAssets/JCUnityLib/Untiy/Picker/DatePickerNew/DatePickerNew.prefab
  18. 1 1
      Assets/WildAttack/Scripts/Arrow.cs
  19. 5 5
      Assets/WildAttack/Scripts/Enemy.cs
  20. 8 2
      Assets/WildAttack/Scripts/Manager/GameMananger.cs
  21. 2 2
      Assets/WildAttack/Scripts/Manager/ProcessManager.cs
  22. 1 1
      Assets/WildAttack/Scripts/StageProperty/Balloon.cs
  23. 2 2
      Assets/WildAttack/Scripts/StageProperty/Barrel.cs
  24. 1 1
      Assets/WildAttack/Scripts/StageProperty/Dart.cs
  25. 2 2
      Assets/WildAttack/Scripts/StageProperty/Ice.cs
  26. 2 2
      Assets/WildAttack/Scripts/StageProperty/Turret.cs

+ 1 - 1
Assets/BowArrow/DoubleScene/Scripts/AutoResetViewNew.cs

@@ -54,7 +54,7 @@ public class AutoResetViewNew : MonoBehaviour
     int showedPrepareTime;
 
     void Update() {
-        prepareTime -= Time.deltaTime;
+        prepareTime -= Time.unscaledDeltaTime;//Time.deltaTime;
         if (prepareTime <= 0) {
             action_OnDestroy?.Invoke();
             Destroy(gameObject);

+ 3 - 0
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/cn.json

@@ -26,6 +26,9 @@
   "UnitCoin": "币",
   "UnitSeconds": "秒",
 
+  "common_male": "男",
+  "common_female": "女",
+
   /**
   登录注册 页面
   **/

+ 3 - 0
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/en.json

@@ -26,6 +26,9 @@
   "UnitCoin": "Coin",
   "UnitSeconds": "Seconds",
 
+  "common_male": "Male",
+  "common_female": "Female",
+
   /**
   登录注册 页面
   **/

+ 4 - 1
Assets/BowArrow/Scripts/Expand/AutoResetView.cs

@@ -17,6 +17,8 @@ public class AutoResetView : MonoBehaviour
 
     public static void DoIdentity() {
         //if (InfraredDemo.running) return;
+        if (SB_EventSystem.ins && SB_EventSystem.ins.simulateMouseIsAwaked) return;
+
         if (SceneManager.GetActiveScene().name.StartsWith("GameDouble"))
         {
             if (GameObject.Find("AutoResetViewNewLeft")) return;
@@ -121,7 +123,8 @@ public class AutoResetView : MonoBehaviour
     bool bEnd = false;
 
     void Update() {
-        prepareTime -= Time.deltaTime;
+        // 使用 unscaledDeltaTime 代替 deltaTime
+        prepareTime -= Time.unscaledDeltaTime;//Time.deltaTime;
         if (prepareTime <= 0) {
             //防止多次调用
             if (bEnd) return;

+ 2 - 2
Assets/FruitMaster/Scripts/AudioManager.cs

@@ -66,7 +66,7 @@ public class AudioManager : MonoBehaviour
         {
             AudioClip clip = GetRandomSound(cat);
             audio.clip = clip;
-            audio.Play();
+            if (UserSettings.ins.openEffect) audio.Play();
         }
 
         if (delay_dstroy_s > 0f)
@@ -88,7 +88,7 @@ public class AudioManager : MonoBehaviour
         {
             AudioClip clip = GetRandomSound(cat); 
             audio.clip = clip;
-            audio.Play();
+            if (UserSettings.ins.openEffect) audio.Play();
         }
 
         if (delay_dstroy_s > 0f)

+ 1 - 1
Assets/FruitMaster/Scripts/CannonController.cs

@@ -95,7 +95,7 @@ public class CannonController : MonoBehaviour
         GamingManager.DelayDestroy(this, explosion, 3f);
         AudioSource fireAudio = gameObject.GetComponent<AudioSource>();
         fireAudio.clip = _gamingManager.GetAudioManager().GetRandomSound(SoundCategory.CannonFire);
-        fireAudio.Play();
+        if (UserSettings.ins.openEffect) fireAudio.Play();
         OnCannonFire.Invoke();
 
     }

+ 1 - 1
Assets/FruitMaster/Scripts/ComboPomegaranteBehavior.cs

@@ -115,7 +115,7 @@ public class ComboPomegaranteBehavior : MonoBehaviour
 
         HitCount++;
         hitAudio.clip = _manager.GetAudioManager().GetRandomSound(SoundCategory.FruitSmash);
-        hitAudio.Play();
+        if (UserSettings.ins.openEffect) hitAudio.Play();
     }
 
     public int GetHitCount()

+ 1 - 1
Assets/FruitMaster/Scripts/FruitBehavior.cs

@@ -266,7 +266,7 @@ public class FruitBehavior : MonoBehaviour
         GameObject fruitJuice = Instantiate(JuiceSplash, gameObject.transform.position, Quaternion.identity);
         AudioSource audio = fruitJuice.AddComponent<AudioSource>();
         audio.clip = _gamingManager.GetAudioManager().GetRandomSound((Type == FruitType.Bomb) ? SoundCategory.BombExplode : SoundCategory.FruitSmash);
-        audio.Play();
+        if (UserSettings.ins.openEffect) audio.Play();
         GamingManager.DelayDestroy(_gamingManager, fruitJuice, (Type == FruitType.Bomb) ? 3f : 1.5f);
         Destroy(gameObject);
     }

+ 12 - 5
Assets/FruitMaster/Scripts/GamingManager.cs

@@ -144,7 +144,10 @@ public class GamingManager : MonoBehaviour
         // Play background music
         AudioSource backgroundMusic = gameObject.GetComponent<AudioSource>();
         backgroundMusic.clip = audioManager.GetBackgroundMusic();
-        backgroundMusic.Play();
+        if (UserSettings.ins.openBGM)
+            backgroundMusic.Play();
+        else
+            backgroundMusic.Stop();
 
         userGameAnalyse1 = UserGameAnalyse1.CreateWhenGameStartAndReturn(15);
     }
@@ -359,6 +362,9 @@ public class GamingManager : MonoBehaviour
         Cannon.OnCannonFire += SpawnAFruit;
 
         FruitWaves = 0;
+
+        //打水果的子弹,在新开一局游戏时,要更新为满弹的状态
+        UpdateTheMagazine();
     }
 
     public void PauseGame()
@@ -694,7 +700,7 @@ public class GamingManager : MonoBehaviour
             //枪模式连接的情况下需要判断子弹
             if (isBulletStatus)
             {
-                if (bulletManager.bulletZero()) return;
+                if (bulletManager.bulletZeroNotDelete()) return;
                 //发射消耗子弹
                 bulletManager.FireBullet();
             }
@@ -705,7 +711,7 @@ public class GamingManager : MonoBehaviour
             {
                 arrow.GetComponent<ArrowBehavior>().Init(speed, dir, true,true);
                 BowFireAudio.clip = audioManager.GetRandomSound(SoundCategory.ArrowFire);
-                BowFireAudio.Play();
+                if (UserSettings.ins.openEffect) BowFireAudio.Play();
             }
             else {
                 //目前只有gun类型
@@ -713,7 +719,7 @@ public class GamingManager : MonoBehaviour
                 int _bulletSpeed = 800;
                 _arrowBehavior.Init(_bulletSpeed, dir.normalized, true, false);
                 BowFireAudio.clip = audioManager.GetRandomSound(SoundCategory.GunFire);
-                BowFireAudio.Play();
+                if (UserSettings.ins.openEffect) BowFireAudio.Play();
                 CheckCollision(_arrowBehavior,spawnPos, dir.normalized , _bulletSpeed);
                 //UnityEditor.EditorApplication.isPaused = true;
             }
@@ -730,6 +736,7 @@ public class GamingManager : MonoBehaviour
     /// 手枪子弹刷新
     /// </summary>
     private void UpdateTheMagazine() {
+        BulletManager.RemoveBulletExternally();
         bulletManager.ResetBullets();
     }
     private void SmartBowFireArrow(float speed)
@@ -897,7 +904,7 @@ public class GamingManager : MonoBehaviour
             {
                 Life = 0;
             }
-            LooseLifeAudio.Play();
+            if (UserSettings.ins.openEffect) LooseLifeAudio.Play();
         }
         else
         {

+ 12 - 4
Assets/Game_Hyperspace/Script/GeneratingTarget.cs

@@ -189,6 +189,12 @@ public class GeneratingTarget : MonoBehaviour
 		CreateUIManager();
 
         CreateTargetObject2D();
+
+        //是否关闭背景音效
+        if (!UserSettings.ins.openBGM) {
+          AudioSource bgm =  GetComponent<AudioSource>();
+          bgm.Stop();
+        }
     }
 
     public void OnRestart()
@@ -265,17 +271,17 @@ public class GeneratingTarget : MonoBehaviour
     void Game1()
     {
         gameSatrtSound.clip = gameSatrtClips[0];
-        gameSatrtSound.Play();
+        if (UserSettings.ins.openEffect) gameSatrtSound.Play();
     }
     void Game2()
     {
         gameSatrtSound.clip = gameSatrtClips[1];
-        gameSatrtSound.Play();
+        if (UserSettings.ins.openEffect) gameSatrtSound.Play();
     }
     void Game3()
     {
         gameSatrtSound.clip = gameSatrtClips[2];
-        gameSatrtSound.Play();
+        if (UserSettings.ins.openEffect) gameSatrtSound.Play();
     }
     void GameStart()
     {
@@ -340,8 +346,10 @@ public class GeneratingTarget : MonoBehaviour
             return;
         }
         else
+        {
             //正常发射的声音
-            ShootingSound.Play();
+            if (UserSettings.ins.openEffect) ShootingSound.Play();
+        }
 
         clipsize--;
         if (clipsize <= 0)

+ 4 - 1
Assets/Game_Hyperspace/Script/SpineAnimationLoader.cs

@@ -69,6 +69,9 @@ public class SpineAnimationLoader : MonoBehaviour
         slider.maxValue = duration;
         transform.localScale = scale;
         _destoryCallBack = destoryCallBack;
+
+        //音效
+        if (!UserSettings.ins.openEffect) source.Stop();
     }
 
     bool isTrue = true;
@@ -92,7 +95,7 @@ public class SpineAnimationLoader : MonoBehaviour
     {
         beShooted = true;//标记不让再点击了
         source.clip = brokenClip;
-        source.Play();
+        if (UserSettings.ins.openEffect) source.Play();
         countDownUI.gameObject.SetActive(false);
         skeletonAnimation.AnimationState.SetAnimation(1, "animation_02", false);
         Invoke("Deferred", 0.7f);

+ 1 - 1
Assets/SmartBow/Resources/SmartBow/Prefabs/Views/GameResultView.prefab

@@ -2019,7 +2019,7 @@ Canvas:
   m_VertexColorAlwaysGammaSpace: 0
   m_AdditionalShaderChannelsFlag: 0
   m_SortingLayerID: 0
-  m_SortingOrder: 999
+  m_SortingOrder: 1001
   m_TargetDisplay: 0
 --- !u!114 &7060471198553422497
 MonoBehaviour:

+ 33 - 0
Assets/SmartBow/Resources/SmartBow/Prefabs/Views/Home/PersonalView.prefab

@@ -5530,6 +5530,7 @@ Canvas:
   m_OverrideSorting: 0
   m_OverridePixelPerfect: 0
   m_SortingBucketNormalizedSize: 0
+  m_VertexColorAlwaysGammaSpace: 0
   m_AdditionalShaderChannelsFlag: 0
   m_SortingLayerID: 0
   m_SortingOrder: 1
@@ -7762,6 +7763,7 @@ GameObject:
   - component: {fileID: 7327544348377892769}
   - component: {fileID: 7327544348377892771}
   - component: {fileID: 7327544348377892770}
+  - component: {fileID: 2003686646252867906}
   m_Layer: 5
   m_Name: Text1
   m_TagString: Untagged
@@ -7831,6 +7833,21 @@ MonoBehaviour:
     m_VerticalOverflow: 0
     m_LineSpacing: 1
   m_Text: "\u5973"
+--- !u!114 &2003686646252867906
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7327544348377892768}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  textKey: common_female
+  layoutRebuildObject: {fileID: 0}
+  languageFontSizes: []
 --- !u!1 &7327544348383879159
 GameObject:
   m_ObjectHideFlags: 0
@@ -10522,6 +10539,7 @@ GameObject:
   - component: {fileID: 7327544349552027244}
   - component: {fileID: 7327544349552027246}
   - component: {fileID: 7327544349552027245}
+  - component: {fileID: 148087519365509265}
   m_Layer: 5
   m_Name: Text0
   m_TagString: Untagged
@@ -10591,6 +10609,21 @@ MonoBehaviour:
     m_VerticalOverflow: 0
     m_LineSpacing: 1
   m_Text: "\u7537"
+--- !u!114 &148087519365509265
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7327544349552027235}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  textKey: common_male
+  layoutRebuildObject: {fileID: 0}
+  languageFontSizes: []
 --- !u!1 &7327544349560049561
 GameObject:
   m_ObjectHideFlags: 0

+ 49 - 9
Assets/SmartBow/Scripts/Common/BulletManager.cs

@@ -33,6 +33,15 @@ public class BulletManager : MonoBehaviour
         ResetBullets();
     }
 
+    public void Update()
+    {
+        if (Input.GetKeyDown(KeyCode.Q))
+        {
+            if (bulletZero()) return;
+            FireBullet();
+        }
+    }
+
     public void FireBullet()
     {
         if (bulletCount > 0)
@@ -64,6 +73,33 @@ public class BulletManager : MonoBehaviour
         }
         return false;
     }
+    /// <summary>
+    /// 不需要自动删除
+    /// </summary>
+    /// <returns></returns>
+    public bool bulletZeroNotDelete() {
+        if (getBulletCount == 0)
+        {
+            //禁用自动删除
+            Create(parent.transform, bCenter, bulletTipColor,true);
+            return true;
+        }
+        return false;
+    }
+    /// <summary>
+    /// 外部调用:手动删除所有 TipBulletNumber
+    /// </summary>
+    public static void RemoveBulletExternally()
+    {
+        for (int i = bulletNumber.Count - 1; i >= 0; i--)
+        {
+            if (bulletNumber[i] != null)
+            {
+                bulletNumber[i].Remove();
+            }
+        }
+        bulletNumber.Clear();
+    }
 
     private void UpdateBullets()
     {
@@ -81,19 +117,24 @@ public class BulletManager : MonoBehaviour
     }
 
 
-    static List<GameObject> bulletNumber = new();
-    public static void Create(Transform parentTran,bool centerPos,Color color)
+    static List<TipBulletNumber> bulletNumber = new();
+    public static void Create(Transform parentTran,bool centerPos,Color color, bool disableAutoDelete = false)
     {
         //清空对象
-        for (int i = bulletNumber.Count - 1; i >= 0; i--)
-        {
-            Destroy(bulletNumber[i].gameObject);
-            bulletNumber.RemoveAt(i);
-        }
+        //for (int i = bulletNumber.Count - 1; i >= 0; i--)
+        //{
+        //    Destroy(bulletNumber[i].gameObject);
+        //    bulletNumber.RemoveAt(i);
+        //}
+        RemoveBulletExternally();
+
         GameObject o = Instantiate(Resources.Load<GameObject>("Common/TipBulletNumber"));
         // 重置Transform属性
         o.transform.SetParent(parentTran);
-        o.GetComponent<TipBulletNumber>().SetOutTipColor(color);
+        TipBulletNumber tip = o.GetComponent<TipBulletNumber>();
+        tip.SetOutTipColor(color);
+        tip.SetDisableAutoDelete(disableAutoDelete); // 设置是否禁用自动删除
+        bulletNumber.Add(tip);
 
         // 获取RectTransform组件
         RectTransform rectTransform = o.GetComponent<RectTransform>();
@@ -115,6 +156,5 @@ public class BulletManager : MonoBehaviour
         }
   
         //o.GetComponentInChildren<Text>().text = number.ToString($"f{CommonConfig.ringsPrecision}");
-        bulletNumber.Add(o);
     }
 }

+ 42 - 3
Assets/SmartBow/Scripts/Common/TipBulletNumber.cs

@@ -6,11 +6,38 @@ using UnityEngine.UI;
 public class TipBulletNumber : MonoBehaviour
 {
     [SerializeField] Text outText;
-    // Start is called before the first frame update
-    IEnumerator Start()
+
+    [SerializeField] private bool autoDelete = true;
+    private bool disableAutoDelete = false;  // 是否禁用自动删除
+    private Coroutine deleteCoroutine; // 记录计时协程,方便取消
+
+    void Start()
+    {
+        if (autoDelete && !disableAutoDelete)
+        {
+            deleteCoroutine = StartCoroutine(AutoDelete());
+        }
+    }
+
+    /// <summary>
+    /// 3秒后自动删除对象(如果 `disableAutoDelete` 为 `false`)
+    /// </summary>
+    private IEnumerator AutoDelete()
     {
         yield return new WaitForSecondsRealtime(3.0f);
-        Destroy(this.gameObject);
+        Destroy(gameObject);
+    }
+
+    /// <summary>
+    /// 手动删除对象
+    /// </summary>
+    public void Remove()
+    {
+        if (deleteCoroutine != null)
+        {
+            StopCoroutine(deleteCoroutine);
+        }
+        Destroy(gameObject);
     }
 
     /// <summary>
@@ -20,6 +47,18 @@ public class TipBulletNumber : MonoBehaviour
     public void SetOutTipColor(Color color) {
         outText.color = color;
     }
+
+    /// <summary>
+    /// 设置是否禁用自动删除
+    /// </summary>
+    public void SetDisableAutoDelete(bool disable)
+    {
+        disableAutoDelete = disable;
+        if (disableAutoDelete && deleteCoroutine != null)
+        {
+            StopCoroutine(deleteCoroutine);
+        }
+    }
 }
 
    

+ 5 - 2
Assets/SmartBow/Scripts/Views/PersonalViewParts/BoxUserSettings.cs

@@ -66,8 +66,11 @@ public class BoxUserSettings : MonoBehaviour
             = LoginMgr.myUserInfo.email;
         inputs.transform.Find("Birthday").GetComponentInChildren<InputField>().text
             = LoginMgr.myUserInfo.birthday;
-        inputs.transform.Find("ItemBox/Region").GetComponentInChildren<InputField>().text
-            = LoginMgr.myUserInfo.country;
+        //如果是中国,直接翻译中国两个字
+        //inputs.transform.Find("ItemBox/Region").GetComponentInChildren<InputField>().text
+        //    = TextAutoLanguage2.GetLanguage() == LanguageEnum.English && LoginMgr.myUserInfo.country == "中国" ? "China" : LoginMgr.myUserInfo.country;
+        inputs.transform.Find("ItemBox/Region").GetComponentInChildren<InputField>().text = LoginMgr.myUserInfo.country;
+
         inputs.transform.Find("ItemBox/Gender/Text0").gameObject.SetActive(LoginMgr.myUserInfo.gender != 2);
         inputs.transform.Find("ItemBox/Gender/Text1").gameObject.SetActive(LoginMgr.myUserInfo.gender == 2);
         inputs.transform.Find("FixBox/Nickname").GetComponent<Text>().text = LoginMgr.myUserInfo.nickname;

+ 4 - 3
Assets/ThirdAssets/JCUnityLib/Untiy/Picker/DatePickerNew/DatePickerNew.prefab

@@ -38,7 +38,7 @@ RectTransform:
   m_AnchorMin: {x: 1, y: 0.5}
   m_AnchorMax: {x: 1, y: 0.5}
   m_AnchoredPosition: {x: -70, y: 0}
-  m_SizeDelta: {x: 120, y: 53}
+  m_SizeDelta: {x: 150, y: 53}
   m_Pivot: {x: 1, y: 0.5}
 --- !u!222 &9170678302914511862
 CanvasRenderer:
@@ -470,7 +470,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0.5}
   m_AnchorMax: {x: 0, y: 0.5}
   m_AnchoredPosition: {x: 70, y: 0}
-  m_SizeDelta: {x: 120, y: 53}
+  m_SizeDelta: {x: 150, y: 53}
   m_Pivot: {x: 0, y: 0.5}
 --- !u!222 &6438697381796672775
 CanvasRenderer:
@@ -962,7 +962,7 @@ MonoBehaviour:
     m_BestFit: 0
     m_MinSize: 0
     m_MaxSize: 114
-    m_Alignment: 0
+    m_Alignment: 2
     m_AlignByGeometry: 0
     m_RichText: 1
     m_HorizontalOverflow: 1
@@ -1200,6 +1200,7 @@ Canvas:
   m_OverrideSorting: 0
   m_OverridePixelPerfect: 0
   m_SortingBucketNormalizedSize: 0
+  m_VertexColorAlwaysGammaSpace: 0
   m_AdditionalShaderChannelsFlag: 0
   m_SortingLayerID: 0
   m_SortingOrder: 100

+ 1 - 1
Assets/WildAttack/Scripts/Arrow.cs

@@ -96,7 +96,7 @@ namespace WildAttack
             audioSource = GetComponent<AudioSource>();
             StartCoroutine(DestroySelf());
             audioSource.clip = Resources.Load<AudioClip>("Voice/Arrow/Shoot");
-            audioSource.Play();
+            if (UserSettings.ins.openEffect) audioSource.Play();
             moveSpeed = Quaternion.Euler(new Vector3(transform.rotation.x, transform.rotation.y, 0)) * transform.forward * speed;
             currentAngle = transform.eulerAngles;
             gravity = -GameModule.GetInstance().GetData("g");

+ 5 - 5
Assets/WildAttack/Scripts/Enemy.cs

@@ -286,7 +286,7 @@ namespace WildAttack
                 if (voiceTime <= 0 && spawnGroupId <= 0)
                 {
                     audioSource.clip = Resources.Load<AudioClip>($"Voice/Enemy/joke_{Random.Range(1, 5)}");
-                    audioSource.Play();
+                    if (UserSettings.ins.openEffect) audioSource.Play();
                     Vector2 voiceSpawn = GameModule.GetInstance().GetDoubleParams("monsterATKVoiceTime");
 
                     voiceTime = Random.Range(voiceSpawn.x, voiceSpawn.y);
@@ -317,7 +317,7 @@ namespace WildAttack
                 if (damage == 1)
                 {
                     audioSource.clip = Resources.Load<AudioClip>("Voice/Enemy/Hitted");
-                    audioSource.Play();
+                    if (UserSettings.ins.openEffect) audioSource.Play();
                 }
                 Dead();
                 // 气球 运动
@@ -352,7 +352,7 @@ namespace WildAttack
                 // 装备受击音效
                 if (damage == 1)
                 {
-                    if (anim != null) anim.GetComponent<AudioSource>().Play();
+                    if (anim != null && UserSettings.ins.openEffect) anim.GetComponent<AudioSource>().Play();
                 }
             }
 
@@ -461,7 +461,7 @@ namespace WildAttack
             if (!GameMananger.GetInstance().isOver)
             {
                 audioSource.clip = Resources.Load<AudioClip>("Voice/Enemy/Attack");
-                audioSource.Play();
+                if (UserSettings.ins.openEffect) audioSource.Play();
                 GameMananger.GetInstance().SubHp(atk);
                 GameObject flotage = FlotagePool.GetInstance().GetGameObject();
                 flotage.SetActive(true);
@@ -491,7 +491,7 @@ namespace WildAttack
         public void SetSpeed(float multiple)
         {
             speed = MonsterModule.GetInstance().GetData(this.monsterId).speed * multiple;
-            transform.Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/body/slow").GetComponentInChildren<ParticleSystem>().Play();
+            if (UserSettings.ins.openEffect) transform.Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/body/slow").GetComponentInChildren<ParticleSystem>().Play();
         }
         public void ResetSpeed()
         {

+ 8 - 2
Assets/WildAttack/Scripts/Manager/GameMananger.cs

@@ -173,7 +173,7 @@ namespace WildAttack
                 // 失败时有城门破坏音效
                 AudioSource ads = GameObject.Find("ProcessAudioSource").GetComponent<AudioSource>();
                 ads.clip = Resources.Load<AudioClip>("Process/Broken");
-                ads.Play();
+                if (UserSettings.ins.openEffect) ads.Play();
             }
 
             //关卡结束时候触发
@@ -254,7 +254,13 @@ namespace WildAttack
             // BGM
             if (!Camera.main.GetComponent<AudioSource>().isPlaying)
             {
-                Camera.main.GetComponent<AudioSource>().Play();
+                if (UserSettings.ins.openBGM)
+                    Camera.main.GetComponent<AudioSource>().Play();
+            }
+            else {
+                //如果正在播放
+                if (!UserSettings.ins.openBGM)
+                    Camera.main.GetComponent<AudioSource>().Stop();
             }
             // 设计间隔
             if (shootSpawn > 0)

+ 2 - 2
Assets/WildAttack/Scripts/Manager/ProcessManager.cs

@@ -132,7 +132,7 @@ namespace WildAttack
                 ResetStayArrows();
                 // 关卡开启时播放
                 audioSource.clip = Resources.Load<AudioClip>("Voice/Process/Change");
-                audioSource.Play();
+                if (UserSettings.ins.openEffect) audioSource.Play();
 
                 // ui change
                 UIManager.GetInstance().SetDefaultProcess(true);
@@ -243,7 +243,7 @@ namespace WildAttack
         {
             if (isOver) return;
             audioSource.clip = Resources.Load<AudioClip>($"Voice/Process/" + (isWin ? "Success" : "Defeat"));
-            audioSource.Play();
+            if (UserSettings.ins.openEffect) audioSource.Play();
             isOver = true;
         }
         #endregion

+ 1 - 1
Assets/WildAttack/Scripts/StageProperty/Balloon.cs

@@ -114,7 +114,7 @@ namespace WildAttack
                 if (isShooted)
                 {
                     audioSource.clip = Resources.Load<AudioClip>("Voice/StageProperty/Balloon_Trigger");
-                    audioSource.Play();
+                    if (UserSettings.ins.openEffect) audioSource.Play();
                 }
                 // 特效
                 particle.GetComponentInChildren<ParticleSystem>().Play();

+ 2 - 2
Assets/WildAttack/Scripts/StageProperty/Barrel.cs

@@ -44,10 +44,10 @@ namespace WildAttack
             {
                 audioSource.clip = Resources.Load<AudioClip>("Voice/StageProperty/Barrel_Trigger");
             }
-            audioSource.Play();
+            if (UserSettings.ins.openEffect) audioSource.Play();
             for (int i = 0; i < particle.childCount; i++)
             {
-                particle.GetChild(0).GetComponent<ParticleSystem>().Play();
+                if (UserSettings.ins.openEffect) particle.GetChild(0).GetComponent<ParticleSystem>().Play();
 
             }
             propData = StagePropertyModule.GetInstance().GetData((int)propType);

+ 1 - 1
Assets/WildAttack/Scripts/StageProperty/Dart.cs

@@ -41,7 +41,7 @@ namespace WildAttack
             if (other.gameObject.layer != LayerMask.NameToLayer("Enemy")) return;
             transform.GetComponent<Collider>().enabled = false;
 
-            audioSource.Play();
+            if (UserSettings.ins.openEffect) audioSource.Play();
 
             StartCoroutine(DestroySelf());
         }

+ 2 - 2
Assets/WildAttack/Scripts/StageProperty/Ice.cs

@@ -44,7 +44,7 @@ namespace WildAttack
                 if (!audioSource.isPlaying)
                 {
                     audioSource.clip = Resources.Load<AudioClip>("Voice/StageProperty/Ice_Hit");
-                    audioSource.Play();
+                    if (UserSettings.ins.openEffect) audioSource.Play();
                 }
             }
             else
@@ -84,7 +84,7 @@ namespace WildAttack
             if (cdLimit <= 0)
             {
                 audioSource.clip = Resources.Load<AudioClip>("Voice/StageProperty/Ice_Trigger");
-                audioSource.Play();
+                if (UserSettings.ins.openEffect) audioSource.Play();
                 propData = StagePropertyModule.GetInstance().GetData((int)propType);
 
                 cdLimit = propData.cd;

+ 2 - 2
Assets/WildAttack/Scripts/StageProperty/Turret.cs

@@ -59,7 +59,7 @@ namespace WildAttack
                 GameObject hitObj = new GameObject();
                 hitObj.transform.position = transform.position;
                 hitObj.AddComponent<AudioSource>().clip = Resources.Load<AudioClip>("Voice/Arrow/Hit");
-                hitObj.GetComponent<AudioSource>().Play();
+                if (UserSettings.ins.openEffect) hitObj.GetComponent<AudioSource>().Play();
 
                 propData = StagePropertyModule.GetInstance().GetData((int)propType);
 
@@ -82,7 +82,7 @@ namespace WildAttack
                 allowRotate = false;
                 paocheTrans.GetComponent<Animator>().SetTrigger("attack");
                 paocheTrans.GetComponentInChildren<ParticleSystem>().Play();
-                paocheTrans.GetComponent<AudioSource>().Play();
+                if (UserSettings.ins.openEffect) paocheTrans.GetComponent<AudioSource>().Play();
                 GameObject dart = GameObject.Instantiate(Resources.Load<GameObject>("StageProperty/dart"), paocheTrans.Find("Bone007/Bone001/gua_dian"));
                 dart.transform.localPosition = Vector3.zero;
                 dart.transform.localScale = Vector3.one;