fix spawn monster

This commit is contained in:
Oscar 2024-03-20 19:15:58 +03:00
parent 20c6b1dad3
commit 148e1e40e1
2 changed files with 6 additions and 4 deletions

View File

@ -61,7 +61,8 @@ namespace Level.BuildModules
private void OnPlayerSpawned()
{
print("SASALKASUKABLYAT");
if (enemyList.Count == networkManager.maxMonsters) return;
if (networkManager.players.Count == networkManager.maxConnections)
{
for (int i = 0; i < networkManager.maxMonsters; i++)

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Mirror;
using UnityEngine;
@ -8,7 +9,7 @@ namespace Level.BuildModules
public enum RoomDoor : byte
{
U,
U = 0,
D,
L,
R,
@ -44,7 +45,7 @@ namespace Level.BuildModules
private readonly SyncHashSet<RoomDoor> _disabledDoors = new();
private void Start()
private void Awake()
{
_doors.AddRange(new List<GameObject>
{
@ -53,7 +54,7 @@ namespace Level.BuildModules
DoorU3, DoorD3, DoorL3, DoorR3
});
// Debug.Log(_doors.Count());
}
public override void OnStartClient()