void OnDisable() { if (mTweeners != null) { switch (m_DisableMode) { case eDisableMode.Pause: for (int i = 0, imax = mTweeners.Length; i < imax; i++) { TweenerBase tween = mTweeners[i]; if (tween != null) { tween.Pause(); } } break; case eDisableMode.Stop: for (int i = 0, imax = mTweeners.Length; i < imax; i++) { TweenerBase tween = mTweeners[i]; if (tween != null) { tween.Stop(); tween.Reset(); } } break; } } }
public void PlayTween(int i, System.Action onFinish) { if (i < 0 || i >= m_Tweens.Length) { return; } if (mTweeners == null) { mTweeners = new TweenerBase[TweenTypeMax + 1]; } TweenData tween = m_Tweens[i]; int ti = (int)tween.tweenType; TweenerBase tweener = mTweeners[ti]; if (tweener != null) { tweener.Stop(); } PlayTweenData(tween); if (onFinish != null) { tweener = mTweeners[ti]; if (tweener != null && tweener.Playing) { tweener.OnFinishEvent += onFinish; } else { try { onFinish(); } catch (System.Exception e) { Debug.LogException(e); } } } }
public bool StopTween(int i, bool reset) { if (mTweeners == null) { return(false); } if (i < 0 || i >= m_Tweens.Length) { return(false); } TweenData tween = m_Tweens[i]; int ti = (int)tween.tweenType; TweenerBase tweener = mTweeners[ti]; if (tweener == null) { return(false); } tweener.Stop(); if (reset) { tweener.Reset(); } return(true); }
public void StopGroup(string group, bool reset) { for (int i = 0, imax = m_Tweens.Length; i < imax; i++) { TweenData tween = m_Tweens[i]; if (string.IsNullOrEmpty(tween.group)) { continue; } if (group != tween.group) { continue; } TweenerBase tweener = mTweeners[(int)tween.tweenType]; if (tweener != null) { tweener.Stop(); if (reset) { tweener.Reset(); } } } }