public void Add(FContainer container) { int id = _containers.Count; _containers.Add(container); container.SetId(id); container.SetSequence(this); }
public void Remove(FContainer container) { if (_containers.Remove(container)) { container.SetSequence(null); UpdateContainerIds(); } }
public static FContainer Create(Color color, string name) { GameObject go = new GameObject(name); FContainer container = go.AddComponent <FContainer>(); container.Color = color; return(container); }
public static FContainer Create(string name, Color color) { GameObject go = new GameObject(name); FContainer container = go.AddComponent <FContainer>(); container.Color = color; container.ConatinerType = ContainerMap[name]; return(container); }
public static FContainer Create(Color color) { GameObject go = new GameObject("Default"); FContainer container = go.AddComponent <FContainer>(); container.Color = color; // go.hideFlags = HideFlags.HideInHierarchy; return(container); }
// sets the timeline it belongs to, only to be called by FTimeline to avoid errors internal void SetContainer(FContainer container) { _container = container; if (_container) { transform.parent = _container.transform; } else { transform.parent = null; } }
public static FSequence CreateSequence(GameObject gameObject) { FSequence sequence = gameObject.AddComponent <FSequence>(); sequence._content = new GameObject("Content").transform; sequence._content.parent = sequence.transform; sequence.Add(FContainer.Create(FContainer.DEFAULT_COLOR, "Group 0")); sequence.Version = FUtility.FLUX_VERSION; return(sequence); }
// Sets sequence reference. It is meant to be called from FSequence, not publicly accessable. // internal void SetSequence( FSequence sequence ) // { // if( _sequence == sequence ) // return; // _sequence = sequence; // if( _sequence ) // { // transform.parent = _sequence.TimelineContainer; // } // else // { // transform.parent = null; // } // } internal void SetContainer(FContainer container) { if (_container == container) { return; } _container = container; if (_container) { transform.parent = container.transform; } else { transform.parent = null; } OnValidate(); }
public static FSequence CreateSequence(GameObject gameObject) { FSequence sequence = gameObject.AddComponent <FSequence>(); sequence._content = new GameObject("SequenceContent").transform; sequence._content.hideFlags |= HideFlags.HideInHierarchy; sequence._content.parent = sequence.transform; sequence.Add(FContainer.Create(FContainer.DEFAULT_COLOR)); sequence.Version = FUtility.FLUX_VERSION; // sequence.AddGlobalTimeline(); // sequence.AddCommentTrack(); // sequence.AddCommentTimeline(); return(sequence); }
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(); }