private void AddText()
        {
            GameObject name = new GameObject("Name", typeof(RectTransform));

            Rect = RedTweenVisualizer.SetRect(name, Panel, 10, -1, 200, 12, 0, 1, 0, 1);
            RedTweenVisualizer.SetText(name, Set.Tag + " - Time: " + Set.Length.ToString() + " sec.", 9, Color.grey);
        }
        public RTTrackViz(RedTween.Track track, GameObject parent, int count, float setLength)
        {
            Track      = track;
            Panel      = new GameObject("Track", typeof(RectTransform));
            mTrackSize = (Track.Length / setLength) * mMaxTrackSize;
            RedTweenVisualizer.SetRect(Panel, parent, 2, -12 * count - 12, mTrackSize, 10, 0, 1, 0, 1);
            RedTweenVisualizer.SetImage(Panel, Color.white, 0.25f);

            float lastPercent = 0;

            for (int i = 0; i < Track.Clips.Count; i++)
            {
                RTClipViz clip = new RTClipViz(Track.Clips[i], Panel, Track.Length, lastPercent);
                Clips.Add(clip);
                lastPercent = clip.EndPercent;
            }

            GameObject markerObj = new GameObject("Track", typeof(RectTransform));

            RedTweenVisualizer.SetRect(markerObj, Panel, 0, 0, 1, 12, 0, 0.5f, 0, 0.5f);
            RedTweenVisualizer.SetImage(markerObj, Color.white, 1f);
            Marker = markerObj.GetComponent <RectTransform>();

            AddText();
        }
Exemple #3
0
            public void Kill()
            {
                // Kills the Set and all of its tweens witout running any of the end actions.
                // It also does not attemtp to put all tweens to thier final targets.
                mEndActions.Clear();
                mActive = false;

                foreach (RedTween.Track track in mTracks.Values)
                {
                    track.Kill();
                }
                RedTween.EndSet(this);
                RedTweenVisualizer.RemoveVizualization(mVisualizer);
            }
Exemple #4
0
            private void End()
            {
                mActive = false;
                RedTween.EndSet(this);

                for (int i = 0; i < mEndActions.Count; i++)
                {
                    if (mEndActions[i] != null)
                    {
                        mEndActions[i]();
                    }
                }
                mEndActions.Clear();
                RedTweenVisualizer.RemoveVizualization(mVisualizer);
            }
        public RTSetViz(RedTween.Set set, GameObject parent, float height)
        {
            Set   = set;
            Panel = new GameObject("Set " + Set.Tag, typeof(RectTransform));
            Rect  = RedTweenVisualizer.SetRect(Panel, parent, 0, height, 600, Set.TrackCount * 12 + 12, 0, 0, 0, 0);
            RedTweenVisualizer.SetImage(Panel, Color.black, 0.95f);
            int i = 0;

            foreach (RedTween.Track track in set.Tracks.Values)
            {
                Tracks.Add(new RTTrackViz(track, Panel, i, Set.Length));
                i++;
            }

            AddText();
        }
        public RTClipViz(RedTweenClip clip, GameObject parent, float trackLength, float lastPercent)
        {
            Clip         = clip;
            Panel        = new GameObject("Clip", typeof(RectTransform));
            ThisPercent  = (Clip.Length / trackLength);
            StartPercent = lastPercent;
            EndPercent   = StartPercent + ThisPercent;
            RedTweenVisualizer.SetRectFull(Panel, parent, 0, 0, 0, 8, StartPercent, 0.5f, EndPercent, 0.5f, 0, 0.5f, Vector3.one);

            RectTransform rt = Panel.GetComponent <RectTransform>();

            rt.offsetMin = new Vector2(1, rt.offsetMin.y);
            rt.offsetMax = new Vector2(-1, rt.offsetMax.y);

            Color c = GetClipColor(Clip.TweenType);

            RedTweenVisualizer.SetImage(Panel, c, 0.5f);
        }
Exemple #7
0
            public void ForceEnd()
            {
                mActive = false;

                foreach (RedTween.Track track in mTracks.Values)
                {
                    track.Kill();
                }

                RedTween.EndSet(this);
                for (int i = 0; i < mEndActions.Count; i++)
                {
                    if (mEndActions[i] != null)
                    {
                        mEndActions[i]();
                    }
                }
                mEndActions.Clear();
                RedTweenVisualizer.RemoveVizualization(mVisualizer);
            }
Exemple #8
0
 public void Visualize(float height)
 {
     mVisualizer = RedTweenVisualizer.Display(this, height);
 }