/// @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) { FTimeline timeline = _timelines[id]; _timelines.RemoveAt(id); // timeline.SetSequence( null ); timeline.SetContainer(null); UpdateTimelineIds(); }
// public void AddGlobalTimeline() // { // if( _globalTimeline != null ) // return; // // _globalTimeline = FTimeline.Create( transform ); // _globalTimeline.IsGlobal = true; // _globalTimeline.SetContainer( this ); // // FTrack commentTrack = FTrack.Create<FCommentEvent>(); // _globalTimeline.AddTrack( commentTrack ); // } // // public void RemoveGlobalTimeline() // { // if( _globalTimeline == null ) // return; // // Destroy( _globalTimeline.gameObject ); // } /// @brief Adds new timeline at the end of the list. /// @param timeline New timeline. public void Add(FTimeline timeline) { int id = _timelines.Count; _timelines.Add(timeline); timeline.SetId(id); // timeline.SetSequence( this ); timeline.SetContainer(this); }
public void Rebuild() { _timelines.Clear(); Transform t = transform; for (int i = 0; i != t.childCount; ++i) { FTimeline timeline = t.GetChild(i).GetComponent <FTimeline>(); if (timeline != null) { // if( timeline.IsGlobal ) // _globalTimeline = timeline; // else _timelines.Add(timeline); timeline.SetContainer(this); timeline.Rebuild(); } } UpdateTimelineIds(); }