tracksOf method
- AnimationClip source
This layer's tracks by animationTrackKey, built once per clip.
Cached on the layer rather than in the player because the layer is what outlives a frame and what knows when its clip changed. Rebuilt when the caller points clip somewhere else, which is the only way it can go stale.
Implementation
Map<int, AnimationTrack> tracksOf(AnimationClip source) {
if (identical(_cachedFor, source)) return _cachedTracks;
_cachedFor = source;
_cachedTracks = <int, AnimationTrack>{
for (final track in source.tracks) animationTrackKey(track): track,
};
return _cachedTracks;
}