fix:使用完枪械 删除枪械,解决后期卡顿问题

This commit is contained in:
bzx
2026-01-21 13:43:20 +08:00
parent 7d584c3cd9
commit 2f72e3b08d
8 changed files with 56 additions and 63 deletions

View File

@@ -366,6 +366,7 @@ public class Player : NetworkRoomPlayer,IDamagable
if (Guns.Count <= 0)
{
Debug.Log("无武器");
PickUpGun(GunType.Pistol,-999);
return;
}
@@ -456,7 +457,7 @@ public class Player : NetworkRoomPlayer,IDamagable
if (rightGun != null)
{
rightGun.gameObject.SetActive(false);
NetworkServer.UnSpawn(rightGun.gameObject);
NetworkServer.Destroy(rightGun.gameObject);
rightGun = null;
}