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)
{
if (!assetId.IsValid())
{
prefab = null;
return false;
}
if (s_GuidToPrefab.ContainsKey(assetId) && s_GuidToPrefab[assetId] != null)
if (assetId.IsValid() && guidToPrefab.ContainsKey(assetId) && guidToPrefab[assetId] != null)
{
prefab = s_GuidToPrefab[assetId];
prefab = guidToPrefab[assetId];
return true;
}
prefab = null;
return false;
}