示例#1
0
        virtual public UCL_Tween AppendInterval(float interval)
        {
            UCL_Tween tween = UCL_TweenTimer.Create();

            tween.SetDuration(interval);
            Append(tween);
            return(tween);
        }
示例#2
0
 /// <summary>
 /// Kill iTween if not null
 /// </summary>
 /// <param name="iTween"></param>
 public static void SmartKill(this UCL_Tween iTween, bool iCompelete = false)
 {
     if (iTween == null)
     {
         return;
     }
     iTween.Kill(iCompelete);
 }
示例#3
0
        internal void Add(UCL_Tween tween)
        {
            if (!m_Inited)
            {
                Init();
            }

            m_TimeManager.Add(tween);
        }
示例#4
0
 internal void Add(UCL_Tween tween)
 {
     if (m_Updating)
     {
         m_NewTweenQue.Enqueue(tween);
         return;
     }
     tween.TweenStart();
     m_Tweens.Add(tween);
 }
示例#5
0
        public void OnInspectorGUI()
        {
            GUILayout.BeginVertical();

            if (m_Tweens != null)
            {
                GUILayout.Box("TweenCount:" + m_Tweens.Count);
                for (int i = 0; i < m_Tweens.Count; i++)
                {
                    var tween = m_Tweens[i];

                    GUILayout.Label(tween.Name);
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button(tween.IsPaused ? "Resume" : "Pause", GUILayout.Width(100)))
                    {
                        tween.SetPause(!tween.IsPaused);
                    }
                    if (GUILayout.Button("Kill", UCL.Core.UI.UCL_GUIStyle.ButtonTextRed, GUILayout.Width(80)))
                    {
                        tween.Kill(false);
                    }
                    if (GUILayout.Button("Kill(Complete)", UCL.Core.UI.UCL_GUIStyle.ButtonTextRed))
                    {
                        tween.Kill(true);
                    }
                    if (GUILayout.Button("Select"))
                    {
                        m_EditorSelectedTween = tween;
                        m_EditorSelectedTween.OnSelected();
                    }
                    GUILayout.EndHorizontal();
                }
            }
            else
            {
                GUILayout.Box("TweenCount: 0");
            }
            if (m_EditorSelectedTween != null)
            {
                if (m_EditorSelectedTween.End)
                {
                    m_EditorSelectedTween = null;
                }
                else
                {
                    m_EditorSelectedTween.OnInspectorGUI();
                }
            }


            GUILayout.EndVertical();
        }
示例#6
0
        /// <summary>
        /// Join a tween to this sequence, tween will start on current appended tween start
        /// </summary>
        /// <param name="tween"></param>
        /// <returns></returns>
        public UCL_Sequence Join(UCL_Tween tween)
        {
            int at = m_Tweens.Count - 1;

            if (at < 0)
            {
                at = 0;
            }
            if (!m_JoinTweens.ContainsKey(at))
            {
                m_JoinTweens[at] = new List <UCL_Tween>();
            }
            m_JoinTweens[at].Add(tween);
            return(this);
        }
示例#7
0
 /// <summary>
 /// Append a tween to this sequence, tween in sequence will start in order
 /// </summary>
 /// <param name="tween">tween to append to this sequence</param>
 /// <returns></returns>
 public UCL_Sequence Append(UCL_Tween tween)
 {
     m_Tweens.Add(tween);
     m_Duration.AlterTime(tween.Duration);
     return(this);
 }