Files
Zombie/Assets/_Zombie/Scripts/Guns/GatlingGun.cs
2025-08-28 10:44:46 +08:00

40 lines
841 B
C#

using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using Mirror;
using UnityEngine;
public class GatlingGun : Launcher
{
[SoundGroup] public string shootSound;
public void Start()
{
if (isServer)
{
// type = GunType.GatlingGun;
// GunInfo gunInfo = GameManager.Ins.GunInfos[type];
// shootRate = gunInfo.ShootRate;
// recoil = gunInfo.Recoil;
}
}
[Server]
public override bool Shoot(Vector3 target, int ownerIndex)
{
bool res = base.Shoot(target, ownerIndex);
if (res)
{
PlayShootSound();
}
return res;
}
[ClientRpc]
public void PlayShootSound()
{
MasterAudio.PlaySound3DAtVector3(shootSound, transform.position);
}
}