From de1cadc7096dee7bf95c188a86a65bf9614a242f Mon Sep 17 00:00:00 2001 From: vis2k Date: Mon, 11 Jun 2018 11:25:01 +0200 Subject: [PATCH] NetworkScene: syntax improvements to simplify code --- Unity-Technologies-networking/Runtime/NetworkScene.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Unity-Technologies-networking/Runtime/NetworkScene.cs b/Unity-Technologies-networking/Runtime/NetworkScene.cs index 14a55d06d..f32d7965c 100644 --- a/Unity-Technologies-networking/Runtime/NetworkScene.cs +++ b/Unity-Technologies-networking/Runtime/NetworkScene.cs @@ -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; }