/// @brief Removes timeline with id. /// @oaram id Id of the CTimeline to remove. /// @note After calling this function, the ids of the timelines after this /// one in the list will have an id smaller by 1. /// @warning Does not check if id is valid (i.e. between -1 & GetTimelines().Count) public void Remove(int id) { FTrack track = _tracks[id]; _tracks.RemoveAt(id); track.SetContainer(null); UpdateTrackIds(); }
public void Remove(FTrack track) { if (_tracks.Remove(track)) { track.SetContainer(null); UpdateTrackIds(); } }
public void Add(FTrack track) { int id = _tracks.Count; _tracks.Add(track); track.SetContainer(this); track.SetId(id); }
/// @brief Adds new timeline at the end of the list. /// @param timeline New timeline. public void Add(FTrack track) { int id = _tracks.Count; _tracks.Add(track); track.SetId(id); // timeline.SetSequence( this ); track.SetContainer(this); }
public void Rebuild() { _tracks.Clear(); Transform t = transform; for (int i = 0; i != t.childCount; ++i) { FTrack track = t.GetChild(i).GetComponent <FTrack>(); if (track != null) { _tracks.Add(track); track.SetContainer(this); track.Rebuild(); } } UpdateTrackIds(); }