public void Rebuild() { _containers.Clear(); Transform t = Content; for (int i = 0; i != t.childCount; ++i) { FContainer container = t.GetChild(i).GetComponent <FContainer>(); if (container != null) { _containers.Add(container); container.SetSequence(this); container.Rebuild(); } } UpdateContainerIds(); }
/// @brief Rebuilds the sequence. This is to be called whenever timelines, /// tracks, or events are added / removed from the sequence. /// @note You should only call this in editor mode, avoid calling it at runtime. public void Rebuild() { #if FLUX_DEBUG Debug.Log("Rebuilding"); #endif // Transform t = TimelineContainer; // _timelines.Clear(); // // for( int i = 0; i != t.childCount; ++i ) // { // FTimeline timeline = t.GetChild(i).GetComponent<FTimeline>(); // // if( timeline ) // { // if( timeline.IsGlobal ) // { // _globalTimeline = timeline; // } // else // { // _timelines.Add( timeline ); // timeline.SetSequence( this ); // timeline.Rebuild(); // } // } // } _containers.Clear(); Transform t = Content; for (int i = 0; i != t.childCount; ++i) { FContainer container = t.GetChild(i).GetComponent <FContainer>(); if (container != null) { _containers.Add(container); container.SetSequence(this); container.Rebuild(); } } // fix sibling indexes // for( int i = 0; i != _containers.Count; ++i ) // { // Transform containerTransform = _containers[i].transform; // if( containerTransform.GetSiblingIndex() != i ) // containerTransform.SetSiblingIndex( i ); // } UpdateContainerIds(); // if( _globalTimeline == null ) // { // AddGlobalTimeline(); // } // _globalTimeline.Rebuild(); // UpdateTimelineIds(); }