docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct OnDestroy

    Implements
    IEntryPointNode
    INode
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Runtime
    Assembly: solution.dll
    Syntax
    [NodeSearcherItem("Events/On Destroy")]
    [Serializable]
    [NodeDescription("The **On Destroy** event node is triggered when the object containing the script is destroyed.\r\n\r\nThings you won't be able to do after an On Destroy:\r\n- Get data from components within the destroyed object.\r\n- Add Timed nodes such as **Wait**, **Stop Watch** as the script component will be destroyed when they process.\r\n- On Update event won't process after.", Example = "![](OnDestroy/OnDestroyExample_01.gif)\r\n\r\nIn this example, we have a Cube containing a visual script that will:\r\n\r\n1. Trigger the **On Start** event when entering play mode\r\n   1. Wait 2 seconds.\r\n   2. Destroy the game object Cube.\r\n\r\n2. When the Cube get destroyed, the On Destroy event will be triggered.\r\n   1. The message Destroyed will now be written in the console.")]
    public struct OnDestroy : IEntryPointNode, INode

    Fields

    Name Description
    Enabled
    Output

    Methods

    Name Description
    Execute<TCtx>(TCtx)

    Extension Methods

    IVisualScriptingEventReceiverJobExtensions.Schedule<TJob, TEvent>(TJob, VisualScriptingEventSystem, JobHandle)
    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)