mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Removed unnecessarily complex ClientScene.GetSpawnHandler function
This commit is contained in:
parent
c27a9ad1bd
commit
e3c894389d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user