Documentation

Unity Engine

Unity Engine

AnimatableIntChannels

A set of named integer channels that a script component exposes to the animation system.
Read time 1 minuteLast updated 2 days ago

Definition

public sealed class AnimatableIntChannels : IEnumerable<KeyValuePair<string, int>>, IEnumerable

Remarks

Each channel holds an integer value. Animate the channels with discrete curves, which change the value in steps instead of blending between keys. Declare, name, and bind the channels in the same way as for AnimatableFloatChannels.
The following example exposes a channel that selects a frame, and logs the frame when an animation changes it.
using UnityEngine;public class FrameSelector : MonoBehaviour{ // Animate this channel as "frames.Mouth". public AnimatableIntChannels frames = new AnimatableIntChannels(); // Reset runs when you add the component in the Editor. The channel names are saved with the component. void Reset() { frames.SetChannels("Mouth"); } void OnDidApplyAnimationProperties() { Debug.Log("Mouth frame: " + frames[0]); }}

Constructors

Constructor

Description

AnimatableIntChannels()Creates an empty channel set.

Properties

Property

Description

channelCountThe number of channels in the set.
this[]The value of the channel at a position in the set.

Methods

Method

Description

GetChannelNameGets the name of the channel at a position in the set.
GetEnumeratorGets an enumerator that iterates over the name and value of each channel, in the order of the set.
IndexOfFinds the position of a channel in the set by name.
SetChannelsReplaces the channel set with channels that have the given names.

Structs

Struct

Description

AnimatableIntChannels.EnumeratorEnumerates the name and value of each channel in an AnimatableIntChannels set.