docs.unity.cn
    Show / Hide Table of Contents

    Class NodeRuntime

    The NodeRuntime class provides an interface to create a systemgraph runtime and editor node. Implementation of this class exposes the user implementation to the lifecycle of SystemGraph.

    Inheritance
    Object
    Object
    ScriptableObject
    NodeRuntime
    GenericPorts
    PortBridge<T>
    PortValueGenerator<T>
    SumFloats
    TestArray
    DataCastToComputeBufferNode
    DataCastToTextureNode
    NodeAnimationCurve
    NodeBool
    NodeClock
    NodeDouble
    NodeExpandable
    NodeFloat
    NodeGameObject
    NodeInt
    NodeQuaternion
    NodeRenderTexture
    NodeString
    NodeSystemGraph
    NodeTexture2D
    NodeUint
    NodeVector2
    NodeVector3
    NodeVector4
    PrintMessage
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Mechatronics.SystemGraph
    Syntax
    [Serializable]
    public class NodeRuntime : ScriptableObject
    Remarks

    Implement this class in conjunction with NodeCategory attribute to configure your node. See NodeCategoryAttribute for configuration attributes of your node.

    Fields

    _parent

    The bound SystemGraphComponent that coordinate events, scheduler and nodes

    Declaration
    protected SystemGraphComponent _parent
    Field Value
    Type Description
    SystemGraphComponent

    Stores the parent SystemGraphComponent

    _portList

    The port list

    Declaration
    [SerializeField]
    protected List<PortData> _portList
    Field Value
    Type Description
    List<PortData>

    _queryPath

    The query path

    Declaration
    protected string _queryPath
    Field Value
    Type Description
    String

    _tickCPUTimeNs

    Store the last profiling time of the OnTick call of this Node

    Declaration
    protected long _tickCPUTimeNs
    Field Value
    Type Description
    Int64

    Store the last profiling time in nanoseconds

    Properties

    PortDataList

    Gets the port data list.

    Declaration
    public List<PortData> PortDataList { get; }
    Property Value
    Type Description
    List<PortData>

    The port data list.

    QueryPath

    Gets the query path.

    Declaration
    public string QueryPath { get; }
    Property Value
    Type Description
    String

    The query path.

    TickCPUTimeNs

    Gets or sets the tick cpu time ns.

    Declaration
    public long TickCPUTimeNs { get; set; }
    Property Value
    Type Description
    Int64

    The tick cpu time ns.

    Methods

    Disable()

    Forwarded OnDisable Unity event from the parent SystemGraphComponent

    Declaration
    public virtual void Disable()

    Enable(Scheduler.ClockState)

    Forwarded OnEnable Unity event from the parent SystemGraphComponent

    Declaration
    public virtual void Enable(Scheduler.ClockState clockState)
    Parameters
    Type Name Description
    Scheduler.ClockState clockState

    The parameters of the waveform associated to this node

    FixedUpdate()

    Forwarded FixedUpdate Unity event from the parent SystemGraphComponent, if event is registered for this node.

    Declaration
    public virtual void FixedUpdate()

    Initialize(SystemGraphComponent)

    Initialize is called by SystemGraphComponent parent to bind the parent to the Node and to call the InternalInitialize event of the node.

    Declaration
    public void Initialize(SystemGraphComponent parent)
    Parameters
    Type Name Description
    SystemGraphComponent parent

    The SystemGraphComponent that owns this node

    InitializeDynamicPorts(SystemGraphComponent)

    Called at start of runtime execution to load ports from PortList. Override for custom behaviour on load.

    Declaration
    public virtual bool InitializeDynamicPorts(SystemGraphComponent parent)
    Parameters
    Type Name Description
    SystemGraphComponent parent

    The parent.

    Returns
    Type Description
    Boolean

    Returns true if the ports are succesfully loaded

    InternalInitialize()

    The implementation of this virtual function shall handle special initialization code to handle when the graph is initialized.

    Declaration
    public virtual void InternalInitialize()

    OnPortAdded(String, Type, String, PortDirection, FieldExtra, ref IPortType)

    PortAddition event recieved from the editor during edit mode if ExpandablePorts attribute is set. By default this function will accept all ports.

    Declaration
    public virtual bool OnPortAdded(string entryName, Type portType, string tooltip, PortDirection direction, FieldExtra extra, ref IPortType portReference)
    Parameters
    Type Name Description
    String entryName

    The name of the new port

    Type portType

    Type of the port object

    String tooltip

    The tooltip.

    PortDirection direction

    The direction.

    FieldExtra extra

    The extra.

    IPortType portReference

    The port reference.

    Returns
    Type Description
    Boolean

    Returns true if the port is accepted

    OnPortRemoved(String)

    Port removal event recieved from the editor during edit mode if ExpandablePorts attribute is set. By default this function will reject all removeals

    Declaration
    public virtual bool OnPortRemoved(string entryName)
    Parameters
    Type Name Description
    String entryName

    The name of the port to remove

    Returns
    Type Description
    Boolean

    Returns true if the port is removed

    OnTick(Double, Double, Scheduler.ClockState, Scheduler.Signal)

    OnTick event received from the scheduler for this node waveform. This is received for every rising edge of the waveform at the frequency configured in the scheduler.

    Declaration
    public virtual bool OnTick(double now, double eventTime, Scheduler.ClockState clockState, Scheduler.Signal signal)
    Parameters
    Type Name Description
    Double now

    The current time in seconds of the scheduler clocksource

    Double eventTime

    The current time in seconds of the scheduler waveform. This is independant from the clocksource time and aligned to every rising edge time in the waveform.

    Scheduler.ClockState clockState

    The current parameters of the waveform event associated to this node

    Scheduler.Signal signal

    Signals that the scheduler pass to the OnTick event receiver. These are signals that describe the action that should be done in the Node. For example, integrate this tick as multiple events.

    Returns
    Type Description
    Boolean

    Returns true if time integration was performed

    Start()

    Forwarded Start Unity event from the parent SystemGraphComponent

    Declaration
    public virtual void Start()

    Update()

    Forwarded Update Unity event from the parent SystemGraphComponent, if event is registered for this node.

    Declaration
    public virtual void Update()
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use