docs.unity.cn
    Show / Hide Table of Contents

    Class PortType<T>

    Generic port type to simplify port creation.

    Inheritance
    Object
    IPortType
    PortType<T>
    PortTypeAnimationCurve
    PortTypeBool
    PortTypeEnum
    PortTypeFloat
    PortTypeGameObject
    PortTypeInt
    PortTypeQuaternion
    PortTypeString
    PortTypeTexture2D
    PortTypeUint
    PortTypeVector2
    PortTypeVector3
    PortTypeVector4
    Inherited Members
    IPortType.globalId
    IPortType.uniqueId
    IPortType.synchronizeAfterLinking
    IPortType.Clock
    IPortType.ChangeEvent
    IPortType.Batching
    IPortType.SignalBatch
    IPortType.Connected
    IPortType.Driver
    IPortType.SetConnected(Boolean)
    IPortType.SetSynchronizeAfterLinking(Boolean)
    IPortType.SetAsDriver(Object)
    IPortType.BeginBatch()
    IPortType.EndBatch()
    IPortType.TypeNiceName(Type)
    Namespace: Mechatronics.SystemGraph
    Syntax
    [Serializable]
    public class PortType<T> : IPortType
    Type Parameters
    Name Description
    T

    Data type underlying the port.

    Constructors

    PortType()

    Creates the port and sets the exposed type.

    Declaration
    public PortType()

    PortType(T)

    Creates a port with default value.

    Declaration
    public PortType(T value)
    Parameters
    Type Name Description
    T value

    Default value for the data.

    Fields

    Data

    The data field

    Declaration
    [SerializeField]
    protected T Data
    Field Value
    Type Description
    T

    Properties

    Read

    Read filtered data from the port.

    Declaration
    public virtual T Read { get; }
    Property Value
    Type Description
    T

    The read.

    ReadRaw

    Read unfiltered data from the port.

    Declaration
    public T ReadRaw { get; }
    Property Value
    Type Description
    T

    The read raw.

    Write

    Write to the port and propagate to change event handlers and port filters.

    Declaration
    public T Write { set; }
    Property Value
    Type Description
    T

    The write.

    WriteRaw

    Write without port filters of change events.

    Declaration
    public T WriteRaw { set; }
    Property Value
    Type Description
    T

    The write raw.

    Methods

    CopyFrom(PortType<T>)

    Copies from.

    Declaration
    protected virtual void CopyFrom(PortType<T> port)
    Parameters
    Type Name Description
    PortType<T> port

    The port.

    CreateFieldBox()

    Creates the field box.

    Declaration
    public override IFieldBox CreateFieldBox()
    Returns
    Type Description
    IFieldBox

    IFieldBox.

    Overrides
    IPortType.CreateFieldBox()

    Propagate(Double)

    Propagate all signals

    Declaration
    public override void Propagate(double tickDelta = 0)
    Parameters
    Type Name Description
    Double tickDelta

    tick

    Overrides
    IPortType.Propagate(Double)

    Ref()

    Get a reference to the underlying data. Propagates change events.

    Declaration
    public ref T Ref()
    Returns
    Type Description
    T

    Reference value as T.

    SetOnChangeClockRisingEdge(Boolean)

    Set the ports to callback on new data

    Declaration
    public override void SetOnChangeClockRisingEdge(bool actAsClock = true)
    Parameters
    Type Name Description
    Boolean actAsClock

    if set to true [act as clock].

    Overrides
    IPortType.SetOnChangeClockRisingEdge(Boolean)

    Synchronize()

    Synchronizes this instance.

    Declaration
    public override void Synchronize()
    Overrides
    IPortType.Synchronize()

    ToString()

    Converts the port data into a string.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    The string if the port is connected. Otherwise, returns null.

    Overrides
    Object.ToString()

    TryGetValue()

    Try to get the value on this port.

    Declaration
    public override object TryGetValue()
    Returns
    Type Description
    Object

    Value on the port if it exists

    Overrides
    IPortType.TryGetValue()

    TrySetValue(Object)

    Try to set a value on this port if it is allowed

    Declaration
    public override bool TrySetValue(object val)
    Parameters
    Type Name Description
    Object val

    Value to set.

    Returns
    Type Description
    Boolean

    True on success.

    Overrides
    IPortType.TrySetValue(Object)
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use