diff --git a/Assets/_MrCs/Scripts/Guns/Pistol.cs b/Assets/_MrCs/Scripts/Guns/Pistol.cs index 40713cba..3f4b401a 100644 --- a/Assets/_MrCs/Scripts/Guns/Pistol.cs +++ b/Assets/_MrCs/Scripts/Guns/Pistol.cs @@ -65,7 +65,6 @@ public class Pistol : Launcher public void Update() { - Debug.Log(isOwned); if (!isOwned) { return; diff --git a/Assets/_MrCs/Scripts/Guns/StunGun.cs b/Assets/_MrCs/Scripts/Guns/StunGun.cs index f677c09e..5fb9d519 100644 --- a/Assets/_MrCs/Scripts/Guns/StunGun.cs +++ b/Assets/_MrCs/Scripts/Guns/StunGun.cs @@ -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] diff --git a/Assets/_MrCs/Scripts/Player/Player.cs b/Assets/_MrCs/Scripts/Player/Player.cs index 1d6a5a87..c5555c86 100644 --- a/Assets/_MrCs/Scripts/Player/Player.cs +++ b/Assets/_MrCs/Scripts/Player/Player.cs @@ -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; } ///