Removed unnecessarily complex ClientScene.GetSpawnHandler function

This commit is contained in:
vis2k 2018-12-17 13:35:21 +01:00
parent c27a9ad1bd
commit e3c894389d

View File

@ -349,17 +349,6 @@ public static void ClearSpawners()
unspawnHandlers.Clear();
}
internal static bool GetSpawnHandler(Guid assetId, out SpawnDelegate handler)
{
if (spawnHandlers.ContainsKey(assetId))
{
handler = spawnHandlers[assetId];
return true;
}
handler = null;
return false;
}
internal static bool InvokeUnSpawnHandler(Guid assetId, GameObject obj)
{
if (unspawnHandlers.ContainsKey(assetId) && unspawnHandlers[assetId] != null)
@ -471,7 +460,7 @@ static void OnSpawnPrefab(NetworkMessage netMsg)
ApplySpawnPayload(localObject, msg.position, msg.payload, msg.netId);
}
// lookup registered factory for type:
else if (GetSpawnHandler(msg.assetId, out handler))
else if (spawnHandlers.TryGetValue(msg.assetId, out handler))
{
GameObject obj = handler(msg.position, msg.assetId);
if (obj == null)