My original prefabs(which is attached models, shader, animation, material, scripts, etc) were disappeared by accident. I can only download unity3d file through server. Downloaded objects is visible in UnityEditor. But I can't store them as prefabs(using drag and drop OR script). All components missed.
Question:
- Why this is impossible(gameobject is loaded in RAM but why can't I store them in disk)?
- How can I recover them?
The short answer would be no, you can not just create a prefab at runtime.
The reason for this is that making prefabs is editor only relying on prefabUtility which is part of the UnityEditor namespace, hence only available outside of runtime (which relies on the UnityEngine namespace).
Assets also get pretty much all get locked to read-only during run time.
However that does not mean it is completely impossible to restore your GameObjects as Prefabs.
You could write your own script that serializes the GameObjects you want as prefabs into a format like JSON or XML, then make an editor script that de-serializes this data and reconstruct a new prefab out of this. You would have to figure out how to do this precisely on your own though as i personally do not have any examples on how to best handle this.
more on JSON serialization can be found here