cleanup qnetworkscene

This commit is contained in:
Mister_Nebula 2021-08-29 16:46:11 +01:00
parent 979fe21e9b
commit dd4481e820

View File

@ -8,11 +8,8 @@ namespace QuantumUNET
internal class QNetworkScene
{
internal static Dictionary<NetworkHash128, GameObject> guidToPrefab { get; } = new Dictionary<NetworkHash128, GameObject>();
internal static Dictionary<NetworkHash128, QSpawnDelegate> spawnHandlers { get; } = new Dictionary<NetworkHash128, QSpawnDelegate>();
internal static Dictionary<NetworkHash128, UnSpawnDelegate> unspawnHandlers { get; } = new Dictionary<NetworkHash128, UnSpawnDelegate>();
internal Dictionary<NetworkInstanceId, QNetworkIdentity> localObjects { get; } = new Dictionary<NetworkInstanceId, QNetworkIdentity>();
internal void Shutdown()
@ -76,7 +73,8 @@ namespace QuantumUNET
return result;
}
internal bool RemoveLocalObject(NetworkInstanceId netId) => localObjects.Remove(netId);
internal bool RemoveLocalObject(NetworkInstanceId netId)
=> localObjects.Remove(netId);
internal bool RemoveLocalObjectAndDestroy(NetworkInstanceId netId)
{
@ -95,7 +93,8 @@ namespace QuantumUNET
return result;
}
internal void ClearLocalObjects() => localObjects.Clear();
internal void ClearLocalObjects()
=> localObjects.Clear();
internal static void RegisterPrefab(GameObject prefab, NetworkHash128 newAssetId)
{
@ -272,16 +271,5 @@ namespace QuantumUNET
ClearLocalObjects();
}
internal void DumpAllClientObjects()
{
foreach (var networkInstanceId in localObjects.Keys)
{
var networkIdentity = localObjects[networkInstanceId];
Debug.Log(networkIdentity != null
? $"ID:{networkInstanceId} OBJ:{networkIdentity.gameObject} AS:{networkIdentity.AssetId}"
: $"ID:{networkInstanceId} OBJ: null");
}
}
}
}