네트워크 멀티플레이 대응

This commit is contained in:
2026-01-31 20:49:23 +09:00
parent 1152093521
commit c5bcf265d0
69 changed files with 2766 additions and 1392 deletions

View File

@@ -16,9 +16,9 @@ namespace Northbound
public List<Transform> spawnPoints = new List<Transform>();
public bool useRandomSpawn = false;
public bool findSpawnPointsAutomatically = true;
private Dictionary<ulong, int> _clientSpawnIndices = new Dictionary<ulong, int>();
private int _nextSpawnIndex = 0;
private NetworkVariable<int> networkNextSpawnIndex = new NetworkVariable<int>(0);
private void Awake()
{
@@ -100,8 +100,8 @@ namespace Northbound
{
if (!_clientSpawnIndices.ContainsKey(clientId))
{
_clientSpawnIndices[clientId] = _nextSpawnIndex;
_nextSpawnIndex = (_nextSpawnIndex + 1) % spawnPoints.Count;
_clientSpawnIndices[clientId] = networkNextSpawnIndex.Value;
networkNextSpawnIndex.Value = (networkNextSpawnIndex.Value + 1) % spawnPoints.Count;
}
spawnIndex = _clientSpawnIndices[clientId];
}