Class NodeDefinition | Data Flow Graph | 0.16.0-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Class NodeDefinition

    Base class for all node definition declarations. Provides helper functionality and base implementations around NodeDefinition.

    A NodeDefinition instance exists per existing NodeSet.

    Inheritance
    Object
    NodeDefinition
    ComponentNode
    KernelNodeDefinition<TKernelPortDefinition>
    SimulationNodeDefinition<TSimulationPortDefinition>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.DataFlowGraph
    Syntax
    public abstract class NodeDefinition

    Properties

    HasStaticPortDescription

    Returns whether this node type's input and output ports are always fixed (see GetStaticPortDescription()).

    Declaration
    public bool HasStaticPortDescription { get; }
    Property Value
    Type Description
    Boolean

    Set

    The NodeSet associated with this instance of this node definition.

    Declaration
    protected NodeSet Set { get; }
    Property Value
    Type Description
    NodeSet

    Methods

    Destroy(DestroyContext)

    Destructor, provides an opportunity to clean up resources related to this instance. Destroy(NodeHandle)

    Declaration
    protected virtual void Destroy(DestroyContext ctx)
    Parameters
    Type Name Description
    DestroyContext ctx
    Remarks

    It is undefined behaviour to throw an exception from this method.

    Dispose()

    Called when disposing a NodeSet. Dispose()

    Declaration
    protected virtual void Dispose()

    EmitMessage<T, TNodeDefinition>(NodeHandle, MessageOutput<TNodeDefinition, T>, T)

    Emit a message from yourself on a port. Everything connected to it will receive your message.

    Declaration
    [Obsolete("Functionality moved to MessageContext/UpdateContext.EmitMessage")]
    protected void EmitMessage<T, TNodeDefinition>(NodeHandle from, MessageOutput<TNodeDefinition, T> port, in T msg)
        where TNodeDefinition : NodeDefinition
    Parameters
    Type Name Description
    NodeHandle from
    MessageOutput<TNodeDefinition, T> port
    T msg
    Type Parameters
    Name Description
    T
    TNodeDefinition

    GetPortDescription(NodeHandle)

    Retrieve the runtime type information about the given node's input and output ports (see PortDescription.

    Declaration
    public PortDescription GetPortDescription(NodeHandle handle)
    Parameters
    Type Name Description
    NodeHandle handle
    Returns
    Type Description
    PortDescription

    GetStaticPortDescription()

    Retrieve the static type information about this node type's input and output ports (see PortDescription).

    Declaration
    public PortDescription GetStaticPortDescription()
    Returns
    Type Description
    PortDescription
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this node type does not have a static port description (HasStaticPortDescription)

    Init(InitContext)

    Constructor function, called for each instantiation of this type. Create<TDefinition>()

    Declaration
    protected virtual void Init(InitContext ctx)
    Parameters
    Type Name Description
    InitContext ctx

    Provides initialization context and do-once operations for this particular node. Init(InitContext)

    Remarks

    It is undefined behaviour to throw an exception from this method.

    OnUpdate(UpdateContext)

    Declaration
    protected virtual void OnUpdate(in UpdateContext ctx)
    Parameters
    Type Name Description
    UpdateContext ctx
    Remarks

    It is undefined behaviour to throw an exception from this method.

    In This Article
    • Properties
      • HasStaticPortDescription
      • Set
    • Methods
      • Destroy(DestroyContext)
      • Dispose()
      • EmitMessage<T, TNodeDefinition>(NodeHandle, MessageOutput<TNodeDefinition, T>, T)
      • GetPortDescription(NodeHandle)
      • GetStaticPortDescription()
      • Init(InitContext)
      • OnUpdate(UpdateContext)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023