40 lines
841 B
C#
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);
|
|
}
|
|
|
|
}
|