How do you save a seed?

If I generate a random level how do I save the seed itself. I’m trying to do it like, after it runs all the code to generate the level it gets the seed, then saves it to a variable. Then if the level is reloaded it will load that variable seed instead. Just as an example, it would run something like this, pseudocode obviously.

if(savedseed= false)
{
level generation stuff runs here
{
seed = savedseed
savedseed = true
}
}

if(savedseed = true)
{
Load seed.savedseed
}

Hope that makes sense. Just let me know if it doesn’t.

Just as you would save pretty much anything else.

A few options:

Player Prefs

Unity Serializer

Custom Serialization: Binary, XML, JSON, …

Depends on your needs, but you could probly go with something as simple as Player Prefs since normally a seeds is just a number or a string.