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

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