Parameter | Description |
---|---|
asset | Any GameObject that is part of the Prefab Asset to save. |
savedSuccessfully | The result of the save action, either successful or unsuccessful. Use this together with the console log to get more insight into the save process. |
GameObject The root GameObject of the saved Prefab Asset.
Saves the version of an existing Prefab Asset that exists in memory back to disk.
The GameObject must be part of an existing prefab asset. If you pass a GameObject from an instance of a prefab asset in a scene, Unity automatically finds and saves the corresponding prefab asset instead.
Additional resources: PrefabUtility.SaveAsPrefabAsset, PrefabUtility.GetCorrespondingObjectFromSource.