OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
817 stars 70 forks source link

how to save generated map but in game ? #33

Closed stickylabdev closed 4 years ago

stickylabdev commented 4 years ago

for exaample , play the project then click generate map then back to main menu then go to that map agan without generating level but use last generated map

longtran2904 commented 4 years ago

I think you should save the seed of the generated map because the generated map will be the same if has the same seed.

OndrejNepozitek commented 4 years ago

As longtran2904 said, you can generate the same map by storing the seed of the generator and then generating a level with the same seed.

You should be also able to create a prefab from the game object that holds the whole level. However, there were some problems with Unity do properly serializing whether a collider is disabled or enabled, so I don't know whether this approach doesn't come with some weird side effects that I'm not aware of.