Esempio n. 1
0
        public void Add(FContainer container)
        {
            int id = _containers.Count;

            _containers.Add(container);
            container.SetId(id);
            container.SetSequence(this);
        }
Esempio n. 2
0
        public void Remove(FContainer container)
        {
            if (_containers.Remove(container))
            {
                container.SetSequence(null);

                UpdateContainerIds();
            }
        }
Esempio n. 3
0
        public static FContainer Create(Color color, string name)
        {
            GameObject go        = new GameObject(name);
            FContainer container = go.AddComponent <FContainer>();

            container.Color = color;

            return(container);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 // 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;
     }
 }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        // 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();
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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();
        }
Esempio n. 11
0
        /// @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();
        }