fix:调整道具枪倒计时问题

This commit is contained in:
bzx
2026-01-20 17:54:27 +08:00
parent b8273b222c
commit b987894780
3 changed files with 5 additions and 26 deletions

View File

@ -65,7 +65,6 @@ public class Pistol : Launcher
public void Update()
{
Debug.Log(isOwned);
if (!isOwned)
{
return;

View File

@ -74,8 +74,6 @@ public class StunGun : Launcher
[Command]
private void CmdShoot()
{
// 让所有客户端显示激光
RpcShowLaser();
@ -120,24 +118,6 @@ public class StunGun : Launcher
bullet_prefab.SetActive(false);
}
[ClientRpc]
// private void RpcSetLaserEndPoint(Vector3 endPos)
// {
// if (stunEffectPos.parent != null)
// {
// // 若 VFX 使用 local需要转换
// var v3 = stunEffectPos.parent.InverseTransformPoint(endPos);
// v3 = new Vector3(0, 0, endPos.z);
// stunEffectPos.localPosition = v3;
// }
// else
// {
// // 若 VFX 使用 world space
// stunEffectPos.position = endPos;
// }
// }
// ====================== 服务器伤害计算 ======================
[Server]

View File

@ -195,7 +195,6 @@ public class Player : NetworkRoomPlayer,IDamagable
{
AimVec = Aim.position;
}
if (IsUserAirdropItem&& curGun!=null && curGun.userTime > 0)
{
curGun.curUserTime-=Time.deltaTime;
@ -273,8 +272,7 @@ public class Player : NetworkRoomPlayer,IDamagable
Debug.Log("创建武器中...");
PickUpGun(GunType.Pistol, GameManager.Ins.GunInfos[GunType.Pistol][1].BulletAmount);
}
[ClientRpc]
public void ClearGun()
{
@ -314,8 +312,7 @@ public class Player : NetworkRoomPlayer,IDamagable
dieArmorPre.SetActive(true);
dieHelmetPre.SetActive(true);
}
[ClientRpc]
public void RpcShowKillUI()
{
@ -451,6 +448,9 @@ public class Player : NetworkRoomPlayer,IDamagable
NetworkServer.Spawn(right.gameObject,gameObject);
curGun = right;
}
if (gunType != GunType.Pistol)
IsUserAirdropItem = true;
}
/// <summary>