Advertisement
Sc2ad

LevelManager.LoadLevel - SpawnLevelGeo

Mar 25th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. `LevelManager.LoadLevel` is where the level geoset is loaded
  2. Specifically, a call to `SpawnLevelGeo`
  3.  
  4. Here's what that call does, to the best of my knowledge (many things omitted):
  5.  
  6. Creates a new `GameObject` with the name: `LevelRoot`
  7. Calls `get_transform` of that `GameObject`, sets it to the `levelRoot` field in `LevelManager`
  8. Gets the `geoSet` field off of the `GameMap` parameter
  9. Calls `LevelManager.SpawnChunks` on the `GameMap`, `geoSet`, `LevelAssetDatabase` (parameter)
  10. Iterates over each of the `WorldObject`s from the `GeoSet`'s `staticProps` field
  11. - Calls `LevelManager.SpawnWorldObject` on the current `WorldObject` and the `get_transform` of the instantiated `GameObject` as the parent transform
  12. Then it destroys that list
  13. Iterates over each of the `WorldObject`s from the `GeoSet`'s `dynamicProps` field
  14. - Calls `LevelManager.SpawnWorldObject` identically
  15. Then it destroys that list
  16. Clears the `LevelManager.cullingEntries` field
  17. Clears the `LevelManager.cullingLookup` field
  18. Gets the `GameMap`'s `data` field, and the `staticCullingRanges`, iterates over each of them:
  19. - Calls `LevelManager.SpawnWorldObjects` on the current culling range
  20. Then it destroys that list
  21. Next, it calls `LODSwitcher.PrepForBatching`
  22. Calls `StaticBatchingUtility.Combine(levelRoot.get_gameObject())`
  23. Iterates over each of the `WorldObject`s from the `GeoSet`'s `dynamicProps` field:
  24. - Calls `LevelManager.SpawnWorldObject` the same way as before
  25. Gets the `gameMap`'s `data` field's `simpleDynamicWorldObjects`, iterates over these:
  26. - Calls `LevelManager.SpawnWorldObject` the same way as before
  27. Iterates over `gameMap`'s `data` field's `dynamicCullingRanges`:
  28. - Calls `LevelManager.SpawnWorldObjects` on the culling range
  29. Clears the `obstacles` list
  30. Gets the `gamemap`'s `trackData` field's `beats` field, iterates over them:
  31. - Gets the beat's `obstacles` field, iterates over those, and calls `LevelManager.SpawnObstacle` on the `gameMap`, the current `BeatData`, the current `ObstacleData`, and the `db` parameter
  32. Yeets both lists after
  33. Requests a `Message` pertaining to `PlayerHeightEvent`
  34. Waits for an unknown quantity of seconds
  35. Attempts to send a `Message` pertaining to `PlayerHeightEvent` (these last 3 are related to a synchronization procedure not done often in Unity)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement