UnityEngine.Networking.ClientScene.OnObjectSpawnScene C# (CSharp) Method

OnObjectSpawnScene() private static method

private static OnObjectSpawnScene ( NetworkMessage netMsg ) : void
netMsg NetworkMessage
return void
        private static void OnObjectSpawnScene(NetworkMessage netMsg)
        {
            NetworkIdentity identity;
            netMsg.ReadMessage<ObjectSpawnSceneMessage>(s_ObjectSpawnSceneMessage);
            if (LogFilter.logDebug)
            {
                Debug.Log(string.Concat(new object[] { "Client spawn scene handler instantiating [netId:", s_ObjectSpawnSceneMessage.netId, " sceneId:", s_ObjectSpawnSceneMessage.sceneId, " pos:", s_ObjectSpawnSceneMessage.position }));
            }
            NetworkDetailStats.IncrementStat(NetworkDetailStats.NetworkDirection.Incoming, 10, "sceneId", 1);
            if (s_NetworkScene.GetNetworkIdentity(s_ObjectSpawnSceneMessage.netId, out identity))
            {
                ApplySpawnPayload(identity, s_ObjectSpawnSceneMessage.position, s_ObjectSpawnSceneMessage.payload, s_ObjectSpawnSceneMessage.netId, identity.gameObject);
            }
            else
            {
                NetworkIdentity uv = SpawnSceneObject(s_ObjectSpawnSceneMessage.sceneId);
                if (uv == null)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Spawn scene object not found for " + s_ObjectSpawnSceneMessage.sceneId);
                    }
                }
                else
                {
                    if (LogFilter.logDebug)
                    {
                        Debug.Log(string.Concat(new object[] { "Client spawn for [netId:", s_ObjectSpawnSceneMessage.netId, "] [sceneId:", s_ObjectSpawnSceneMessage.sceneId, "] obj:", uv.gameObject.name }));
                    }
                    ApplySpawnPayload(uv, s_ObjectSpawnSceneMessage.position, s_ObjectSpawnSceneMessage.payload, s_ObjectSpawnSceneMessage.netId, uv.gameObject);
                }
            }
        }