NetworkScene: syntax improvements to simplify code

This commit is contained in:
vis2k 2018-06-11 11:25:01 +02:00
parent a9d87b512e
commit de1cadc709

View File

@ -143,18 +143,13 @@ static internal void RegisterPrefab(GameObject prefab)
} }
static internal bool GetPrefab(NetworkHash128 assetId, out GameObject prefab) static internal bool GetPrefab(NetworkHash128 assetId, out GameObject prefab)
{
if (!assetId.IsValid())
{ {
prefab = null; prefab = null;
return false; if (assetId.IsValid() && guidToPrefab.ContainsKey(assetId) && guidToPrefab[assetId] != null)
}
if (s_GuidToPrefab.ContainsKey(assetId) && s_GuidToPrefab[assetId] != null)
{ {
prefab = s_GuidToPrefab[assetId]; prefab = guidToPrefab[assetId];
return true; return true;
} }
prefab = null;
return false; return false;
} }