|
|
@@ -143,7 +143,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);
|
|
|
}
|
|
|
@@ -341,6 +344,9 @@ public class GamingManager : MonoBehaviour
|
|
|
Cannon.OnCannonFire += SpawnAFruit;
|
|
|
|
|
|
FruitWaves = 0;
|
|
|
+
|
|
|
+ //打水果的子弹,在新开一局游戏时,要更新为满弹的状态
|
|
|
+ UpdateTheMagazine();
|
|
|
}
|
|
|
|
|
|
public void PauseGame()
|
|
|
@@ -667,7 +673,7 @@ public class GamingManager : MonoBehaviour
|
|
|
//枪模式连接的情况下需要判断子弹
|
|
|
if (isBulletStatus)
|
|
|
{
|
|
|
- if (bulletManager.bulletZero()) return;
|
|
|
+ if (bulletManager.bulletZeroNotDelete()) return;
|
|
|
//发射消耗子弹
|
|
|
bulletManager.FireBullet();
|
|
|
}
|
|
|
@@ -678,7 +684,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类型
|
|
|
@@ -686,7 +692,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;
|
|
|
}
|
|
|
@@ -703,6 +709,7 @@ public class GamingManager : MonoBehaviour
|
|
|
/// 手枪子弹刷新
|
|
|
/// </summary>
|
|
|
private void UpdateTheMagazine() {
|
|
|
+ BulletManager.RemoveBulletExternally();
|
|
|
bulletManager.ResetBullets();
|
|
|
}
|
|
|
private void SmartBowFireArrow(float speed)
|
|
|
@@ -870,7 +877,7 @@ public class GamingManager : MonoBehaviour
|
|
|
{
|
|
|
Life = 0;
|
|
|
}
|
|
|
- LooseLifeAudio.Play();
|
|
|
+ if (UserSettings.ins.openEffect) LooseLifeAudio.Play();
|
|
|
}
|
|
|
else
|
|
|
{
|