|
|
@@ -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
|
|
|
{
|