[ Web Proxy ]
URL:
Viewing: https://docs.unity3d.com/ScriptReference/PrefabUtility.SavePrefabAsset.html [Back]  [Original]

Unity - Scripting API: PrefabUtility.SavePrefabAsset
Version: Unity 6.5 (6000.5)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    PrefabUtility.SavePrefabAsset

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close
    Your name Your email Suggestion* Submit suggestion

    Cancel

    Declaration

    public static GameObject SavePrefabAsset(GameObject asset);

    Declaration

    public static GameObject SavePrefabAsset(GameObject asset, out bool savedSuccessfully);

    Parameters

    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.

    Returns

    GameObject The root GameObject of the saved Prefab Asset.

    Description

    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.


    Web Proxy Viewer  |  New URL  |  Original Page