Right way to make procedural generation objects, both in editor and in runtime.

Hello, i want to make a prefab with object, what must initialize himself once, on placing in editor or on instantiating in runtime.
As example - cube with randomized size.
When i spawn cube in runtime, i can make all the stuff in awake method.
But i also want spawn it in editor and see the result of randomization and transfer it in runtime, without changing.

What i need to do? I sure there is an easy way, but cant find it.
[ExecuteAlways\InEditor] loses variables and destroy\awake object during runtime\editor transfering;
I can workaround it, but this is look dirty.

Not sure if i understand your problem correctly, but i guess the Instantiate() function could help you.