docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class KnotLinkCollection

    A collection of KnotLinks to track how spline knots are linked and the utilities to update these links when splines are modified.

    Inheritance
    object
    KnotLinkCollection
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Splines
    Assembly: Unity.Splines.dll
    Syntax
    [Serializable]
    public sealed class KnotLinkCollection

    Properties

    Count

    How many KnotLinks the collection contains.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    Methods

    Clear()

    Clears all the links in the collection.

    Declaration
    public void Clear()

    GetKnotLinks(SplineKnotIndex)

    Gets the knots linked to a specific knot.

    Declaration
    public IReadOnlyList<SplineKnotIndex> GetKnotLinks(SplineKnotIndex knotIndex)
    Parameters
    Type Name Description
    SplineKnotIndex knotIndex

    The SplineKnotIndex of the knot.

    Returns
    Type Description
    IReadOnlyList<SplineKnotIndex>

    Returns a list of knots linked to the specified knot. The specified knot is also in the list.

    KnotIndexChanged(int, int, int)

    Updates the KnotLinkCollection indices after a knot index changes.

    Declaration
    public void KnotIndexChanged(int splineIndex, int previousKnotIndex, int newKnotIndex)
    Parameters
    Type Name Description
    int splineIndex

    The index of the spline.

    int previousKnotIndex

    The previous index of the knot in the spline.

    int newKnotIndex

    The new index of the knot in the spline.

    KnotIndexChanged(SplineKnotIndex, SplineKnotIndex)

    Updates the KnotLinkCollection indices after a knot index changes.

    Declaration
    public void KnotIndexChanged(SplineKnotIndex previousIndex, SplineKnotIndex newIndex)
    Parameters
    Type Name Description
    SplineKnotIndex previousIndex

    The previous SplineKnotIndex of the knot.

    SplineKnotIndex newIndex

    The new SplineKnotIndex of the knot.

    KnotInserted(int, int)

    Updates the KnotLinkCollection indices after a knot has been inserted.

    Declaration
    public void KnotInserted(int splineIndex, int knotIndex)
    Parameters
    Type Name Description
    int splineIndex

    The index of the spline.

    int knotIndex

    The index of the inserted knot in the spline.

    KnotInserted(SplineKnotIndex)

    Updates the KnotLinkCollection indices after a knot has been inserted.

    Declaration
    public void KnotInserted(SplineKnotIndex index)
    Parameters
    Type Name Description
    SplineKnotIndex index

    The SplineKnotIndex of the inserted knot.

    KnotRemoved(int, int)

    Updates the KnotLinkCollection indices after a knot has been removed.

    Declaration
    public void KnotRemoved(int splineIndex, int knotIndex)
    Parameters
    Type Name Description
    int splineIndex

    The index of the spline.

    int knotIndex

    The index of the removed knot in the spline.

    KnotRemoved(SplineKnotIndex)

    Updates the KnotLinkCollection indices after a knot has been removed.

    Declaration
    public void KnotRemoved(SplineKnotIndex index)
    Parameters
    Type Name Description
    SplineKnotIndex index

    The SplineKnotIndex of the removed knot.

    Link(SplineKnotIndex, SplineKnotIndex)

    Links two knots positions to each other. If you link knots that are already linked to other knots, then all of the knots link to each other.

    Declaration
    public void Link(SplineKnotIndex knotA, SplineKnotIndex knotB)
    Parameters
    Type Name Description
    SplineKnotIndex knotA

    The first knot to link.

    SplineKnotIndex knotB

    The first knot to link.

    ShiftKnotIndices(SplineKnotIndex, int)

    Changes the indices of the KnotLinkCollection to ensure they are valid. This is mainly used when splines or knots are inserted or removed from a SplineContainer.

    Declaration
    public void ShiftKnotIndices(SplineKnotIndex index, int offset)
    Parameters
    Type Name Description
    SplineKnotIndex index

    The SplineKnotIndex of the knot.

    int offset

    The offset to apply on other knots.

    SplineIndexChanged(int, int)

    Updates the KnotLinkCollection indices after a spline index changes.

    Declaration
    public void SplineIndexChanged(int previousIndex, int newIndex)
    Parameters
    Type Name Description
    int previousIndex

    The previous index of that spline in the SplineContainer.

    int newIndex

    The new index of that spline in the SplineContainer.

    SplineRemoved(int)

    Updates the KnotLinkCollection after a spline is removed.

    Declaration
    public void SplineRemoved(int splineIndex)
    Parameters
    Type Name Description
    int splineIndex

    The index of the removed spline.

    TryGetKnotLinks(SplineKnotIndex, out IReadOnlyList<SplineKnotIndex>)

    Gets the knots linked to a specific knot.

    Declaration
    public bool TryGetKnotLinks(SplineKnotIndex knotIndex, out IReadOnlyList<SplineKnotIndex> linkedKnots)
    Parameters
    Type Name Description
    SplineKnotIndex knotIndex

    The SplineKnotIndex of the knot.

    IReadOnlyList<SplineKnotIndex> linkedKnots

    The output list of the knots linked to the specified knot if they exist or null if they do not exist.

    Returns
    Type Description
    bool

    Returns true if linked knots are found, false otherwise.

    Unlink(SplineKnotIndex)

    Unlinks a knot from the knots it is linked to. This method unlinks the knot specified, but does not unlink the other knots from each other.

    Declaration
    public void Unlink(SplineKnotIndex knot)
    Parameters
    Type Name Description
    SplineKnotIndex knot

    The knot to unlink.

    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)