docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SplineRange

    Describes a subset of knot indices in a Spline. The range might iterate in either the forward or backward direction.

    Implements
    IEnumerable<int>
    IEnumerable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: UnityEngine.Splines
    Assembly: solution.dll
    Syntax
    [Serializable]
    public struct SplineRange : IEnumerable<int>, IEnumerable

    Constructors

    Name Description
    SplineRange(int, int)

    Creates a new SplineRange from a start index and count.

    SplineRange(int, int, SliceDirection)

    Creates a new SplineRange from a start index and count.

    Properties

    Name Description
    Count

    Returns the number of indices.

    Direction

    The direction that this range interpolates. Forward increments the knot index when it iterates, whereas Backward decrements this index.

    End

    The inclusive end index of this range.

    this[int]

    Get or set the Spline knot index at an index index. This indexer allows you to write a for loop to iterate through a range without needing to know in which direction the range is iterating.

    // Create a new range into an existing Spline starting at knot 5, and interpolating the span of 3 knots.
    // range[0,1,2] will map to { 6, 5, 4 } respectively.
    var range = new SplineRange(6, 3, SplineDirection.Backward);
    Start

    The inclusive first index, starting at 0.

    Methods

    Name Description
    GetEnumerator()

    Get an enumerator that iterates through the index collection. Note that this will either increment or decrement indices depending on the value of the Direction property.

    ToString()

    Returns a string summary of this range.

    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)