네트워크 멀티플레이 대응
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user