Exemple #1
0
    internal void SpawnMapEntities()
    {
        int i;
        PrefabPreProcess prefabPreProcess = new PrefabPreProcess(false, true, false);

        BaseEntity[] baseEntityArray  = UnityEngine.Object.FindObjectsOfType <BaseEntity>();
        BaseEntity[] baseEntityArray1 = baseEntityArray;
        for (i = 0; i < (int)baseEntityArray1.Length; i++)
        {
            BaseEntity baseEntity = baseEntityArray1[i];
            if (prefabPreProcess.NeedsProcessing(baseEntity.gameObject))
            {
                prefabPreProcess.ProcessObject(null, baseEntity.gameObject, false);
            }
            baseEntity.SpawnAsMapEntity();
        }
        DebugEx.Log(string.Format("Map Spawned {0} entities", (int)baseEntityArray.Length), StackTraceLogType.None);
        baseEntityArray1 = baseEntityArray;
        for (i = 0; i < (int)baseEntityArray1.Length; i++)
        {
            BaseEntity baseEntity1 = baseEntityArray1[i];
            if (baseEntity1 != null)
            {
                baseEntity1.PostMapEntitySpawn();
            }
        }
    }
    internal void SpawnMapEntities()
    {
        PrefabPreProcess prefabPreProcess = new PrefabPreProcess(false, true, false);

        BaseEntity[] objectsOfType = (BaseEntity[])Object.FindObjectsOfType <BaseEntity>();
        foreach (BaseEntity baseEntity in objectsOfType)
        {
            if (prefabPreProcess.NeedsProcessing(((Component)baseEntity).get_gameObject()))
            {
                prefabPreProcess.ProcessObject((string)null, ((Component)baseEntity).get_gameObject(), false);
            }
            baseEntity.SpawnAsMapEntity();
        }
        DebugEx.Log((object)("Map Spawned " + (object)objectsOfType.Length + " entities"), (StackTraceLogType)0);
        foreach (BaseEntity baseEntity in objectsOfType)
        {
            if (Object.op_Inequality((Object)baseEntity, (Object)null))
            {
                baseEntity.PostMapEntitySpawn();
            }
        }
    }