fix:调整联机时最后一波敌人抖动问题

This commit is contained in:
bzx
2025-10-14 10:56:43 +08:00
parent 0e3a2daf97
commit ce4551d58f
4 changed files with 7 additions and 21 deletions

View File

@@ -247,7 +247,7 @@ public class GameManager : NetworkBehaviour
// 延迟1s后给所有人发放武器
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
{
GivePistol();
GivePistol(GunType.Pistol);
}, 1f);
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
{
@@ -257,10 +257,10 @@ public class GameManager : NetworkBehaviour
}
[ClientRpc]
public void GivePistol()
public void GivePistol(GunType type)
{
Debug.Log("创建武器中...");
GameLocal.Ins.self.PickUpGun(GunType.Pistol, -999);
GameLocal.Ins.self.PickUpGun(type, -999);
}
[Server]
@@ -288,7 +288,7 @@ public class GameManager : NetworkBehaviour
{
Debug.LogError("开启End事件");
gameState = GameState.EndEvent;
GameLocal.Ins.self.PickUpGun(GunType.MeleeWeapon, -999);
GivePistol(GunType.MeleeWeapon);
foreach (var item in PlayerAiList.Values)
{
item.EndEvent();