How to save terrain data generated at runtime permanently

Hello everyone.
I generate a lot of terrain at runtime from DEM, and i wanna to save them permanently, how can i realize it? Use AssetBundle or ?

1 Answer

1

If you want to save the place of the object you can save them really easy.
But the position of the object must be in a variable, next you need to use this code:

// Save prefab.
PlayerPrefs.SetInt("var int name", var int name);
// load prefab in debug.log.
Debug.Log(PlayerPrefs.GetInt("var int name"));
//use this to set it to the saved pos.
var int name = PlayerPrefs.GetInt("var int name");

See more here.

I to read some thing about prefab saving: here