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

PrepareToSpawnSceneObjects() static private method

static private PrepareToSpawnSceneObjects ( ) : void
return void
        internal static void PrepareToSpawnSceneObjects()
        {
            s_SpawnableObjects = new Dictionary<NetworkSceneId, NetworkIdentity>();
            foreach (NetworkIdentity identity in UnityEngine.Resources.FindObjectsOfTypeAll<NetworkIdentity>())
            {
                if ((!identity.gameObject.activeSelf && (identity.gameObject.hideFlags != HideFlags.NotEditable)) && ((identity.gameObject.hideFlags != HideFlags.HideAndDontSave) && !identity.sceneId.IsEmpty()))
                {
                    s_SpawnableObjects[identity.sceneId] = identity;
                    if (LogFilter.logDebug)
                    {
                        Debug.Log("ClientScene::PrepareSpawnObjects sceneId:" + identity.sceneId);
                    }
                }
            }
        }

Usage Example

Example #1
0
 private static void OnObjectSpawnFinished(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <ObjectSpawnFinishedMessage>(ClientScene.s_ObjectSpawnFinishedMessage);
     if (LogFilter.logDebug)
     {
         Debug.Log((object)("SpawnFinished:" + (object)ClientScene.s_ObjectSpawnFinishedMessage.state));
     }
     if ((int)ClientScene.s_ObjectSpawnFinishedMessage.state == 0)
     {
         ClientScene.PrepareToSpawnSceneObjects();
         ClientScene.s_IsSpawnFinished = false;
     }
     else
     {
         using (Dictionary <NetworkInstanceId, NetworkIdentity> .ValueCollection.Enumerator enumerator = ClientScene.objects.Values.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 NetworkIdentity current = enumerator.Current;
                 if (!current.isClient)
                 {
                     current.OnStartClient();
                     ClientScene.CheckForOwner(current);
                 }
             }
         }
         ClientScene.s_IsSpawnFinished = true;
     }
 }
All Usage Examples Of UnityEngine.Networking.ClientScene::PrepareToSpawnSceneObjects