mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkScene: syntax improvements to simplify code
This commit is contained in:
parent
a9d87b512e
commit
de1cadc709
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user