docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct WeightedTransformArray

    This struct defines a List of WeightedTransform. WeightedTransformArray can be animated (as opposed to System.List and C# arrays) and is implemented with a hard limit of eight WeightedTransform elements. See also WeightedTransform and WeightRangeAttribute.

    Implements
    IList<WeightedTransform>
    ICollection<WeightedTransform>
    IEnumerable<WeightedTransform>
    IList
    ICollection
    IEnumerable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Animations.Rigging
    Assembly: Unity.Animation.Rigging.dll
    Syntax
    [Serializable]
    public struct WeightedTransformArray : IList<WeightedTransform>, ICollection<WeightedTransform>, IEnumerable<WeightedTransform>, IList, ICollection, IEnumerable

    Constructors

    WeightedTransformArray(int)

    Constructor.

    Declaration
    public WeightedTransformArray(int size)
    Parameters
    Type Name Description
    int size

    Size of the array. This will clamped to be a number in between 0 and k_MaxLength.

    See Also
    k_MaxLength

    Fields

    k_MaxLength

    Maximum number of elements in WeightedTransformArray.

    Declaration
    public static readonly int k_MaxLength
    Field Value
    Type Description
    int

    Properties

    Count

    The number of elements contained in the WeightedTransformArray.

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

    IsFixedSize

    Retrieves whether WeightedTransformArray has a fixed size. Always false.

    Declaration
    public bool IsFixedSize { get; }
    Property Value
    Type Description
    bool

    IsReadOnly

    Retrieves whether WeightedTransformArray is read-only. Always false.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    bool

    this[int]

    Gets or sets the WeightedTransform at the specified index.

    Declaration
    public WeightedTransform this[int index] { get; set; }
    Parameters
    Type Name Description
    int index

    The zero-based index of the WeightedTransform to get or set.

    Property Value
    Type Description
    WeightedTransform

    Methods

    Add(WeightedTransform)

    Adds an item to the WeightedTransformArray.

    Declaration
    public void Add(WeightedTransform value)
    Parameters
    Type Name Description
    WeightedTransform value

    The WeightedTransform to add to the WeightedTransformArray.

    Clear()

    Removes all items from the WeightedTransformArray.

    Declaration
    public void Clear()

    Contains(WeightedTransform)

    Determines whether the WeightedTransformArray contains a specific value.

    Declaration
    public bool Contains(WeightedTransform value)
    Parameters
    Type Name Description
    WeightedTransform value

    The WeightedTransform to locate in the WeightedTransformArray.

    Returns
    Type Description
    bool

    true if the Object is found in the WeightedTransformArray; otherwise, false.

    CopyTo(WeightedTransform[], int)

    Copies the elements of the WeightedTransform to an Array, starting at a particular Array index.

    Declaration
    public void CopyTo(WeightedTransform[] array, int arrayIndex)
    Parameters
    Type Name Description
    WeightedTransform[] array

    The one-dimensional Array that is the destination of the elements copied from WeightedTransform. The Array must have zero-based indexing.

    int arrayIndex

    The zero-based index in array at which copying begins.

    GetEnumerator()

    Returns an enumerator that iterates through a collection.

    Declaration
    public IEnumerator<WeightedTransform> GetEnumerator()
    Returns
    Type Description
    IEnumerator<WeightedTransform>

    An IEnumerator object that can be used to iterate through the collection.

    GetTransform(int)

    Retrieves a Transform reference on a WeightedTransform at specified index.

    Declaration
    public Transform GetTransform(int index)
    Parameters
    Type Name Description
    int index

    Index value.

    Returns
    Type Description
    Transform

    The Transform reference at specified index.

    GetWeight(int)

    Retrieves a weight on a WeightedTransform at specified index.

    Declaration
    public float GetWeight(int index)
    Parameters
    Type Name Description
    int index

    Index value.

    Returns
    Type Description
    float

    The weight value at specified index.

    IndexOf(WeightedTransform)

    Determines the index of a specific item in the WeightedTransformArray.

    Declaration
    public int IndexOf(WeightedTransform value)
    Parameters
    Type Name Description
    WeightedTransform value

    The WeightedTransform to locate in the WeightedTransformArray.

    Returns
    Type Description
    int

    The index of value if found in the list; otherwise, -1.

    Insert(int, WeightedTransform)

    Inserts an item to the WeightedTransformArray at the specified index.

    Declaration
    public void Insert(int index, WeightedTransform value)
    Parameters
    Type Name Description
    int index

    The zero-based index at which value should be inserted.

    WeightedTransform value

    The WeightedTransform to insert into the WeightedTransformArray.

    OnValidate(ref WeightedTransformArray, float, float)

    Method to call from a provider's OnValidate() callback to ensure all weight values are within the valid range. See also WeightRangeAttribute.

    Declaration
    public static void OnValidate(ref WeightedTransformArray array, float min = 0, float max = 1)
    Parameters
    Type Name Description
    WeightedTransformArray array

    WeightedTransformArray to adjust.

    float min

    Minimum value to clamp array values with.

    float max

    Maximum value to clamp array values with.

    Remove(WeightedTransform)

    Removes the first occurrence of a specific WeightedTransform from the WeightedTransformArray.

    Declaration
    public bool Remove(WeightedTransform value)
    Parameters
    Type Name Description
    WeightedTransform value

    The WeightedTransform to remove from the WeightedTransformArray.

    Returns
    Type Description
    bool

    True if value was removed from the array, false otherwise.

    RemoveAt(int)

    Removes the WeightedTransformArray item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    int index

    The zero-based index of the item to remove.

    SetTransform(int, Transform)

    Sets the Transform reference on a WeightedTransform at specified index.

    Declaration
    public void SetTransform(int index, Transform transform)
    Parameters
    Type Name Description
    int index

    Index value.

    Transform transform

    The Transform reference to set.

    SetWeight(int, float)

    Sets a weight on a WeightedTransform at specified index.

    Declaration
    public void SetWeight(int index, float weight)
    Parameters
    Type Name Description
    int index

    Index value.

    float weight

    The weight value to set.

    Implements

    IList<T>
    ICollection<T>
    IEnumerable<T>
    IList
    ICollection
    IEnumerable
    In This Article
    Back to top
    Copyright © 2025 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)