docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method DestroyImmediateSafe

    DestroyImmediateSafe(GameObject, bool)

    Destroys GameObject, but ensure that it is properly unpacked if gameobject is part of a prefab (if editor)

    Declaration
    public static void DestroyImmediateSafe(this GameObject gameObject, bool undo = true)
    Parameters
    Type Name Description
    GameObject gameObject

    The gameobject to destroy

    bool undo

    Should an undo operation be recorded

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)