public void PlayReverse() { mSp = transform.GetComponent <UISprite>(); spriteHeight = mSp.localSize.y; mSp.onPostFill += OnPostFill; TweenHeight tween = TweenHeight.Begin(mSp, duration * .9f, (int)spriteHeight); mSp.alpha = 1; tween.from = (int)spriteHeight; tween.to = 0; tween.animationCurve = heightCurve; EventDelegate.Add(tween.onFinished, OnTweenFinish, true); tweenValue = MUITweenValue.Begin(gameObject, duration * .9f, 1f); tweenValue.startValue = 0f; tweenValue.endValue = 1f; tweenValue.animationCurve = alphaCurve; tweenValue.PlayForward(); timeCount = 0; isEnd = false; isChange = true; isReverse = true; //Invoke("ChangeAlphaAni", duration / 10f); }
void OnMenuClick(GameObject go) { if (isDrag) { return; } isDragOut = true; int index = int.Parse(go.name.Substring(6)) - 1; float amount = .25f * index + bezierValue; if (amount > 1) { amount = amount % 1f; } else if (amount < 0) { amount = amount % 1f + 1; } tweenValue = MUITweenValue.Begin(gameObject, .3f, 0f); tweenValue.CurveValue = bezierValue; tweenValue.startValue = bezierValue; if (amount < .5f) { tweenValue.endValue = bezierValue - amount; } else { tweenValue.endValue = bezierValue + (1 - amount); } if (tweenValue.startValue == tweenValue.endValue) { if (onSelectOneItem != null) { onSelectOneItem(index); isDragOut = false; } } else { if (onBeginRotation != null) { onBeginRotation(); } } tweenValue.PlayForward(); EventDelegate.Add(tweenValue.onFinished, OnTweenMenuFinish, true); }
void OnTweenValueFinish() { float amount = bezierValue; if (amount > 1) { amount = amount % 1f; } else if (amount < 0) { amount = amount % 1f + 1; } tweenValue = MUITweenValue.Begin(gameObject, .3f, 0f); tweenValue.CurveValue = bezierValue; tweenValue.startValue = bezierValue; float endValue = 0f; if (amount < (.25f * .5f)) { endValue = bezierValue - amount; } else if (amount < (.25f * .5f + .25f)) { endValue = bezierValue + (.25f - amount); } else if (amount < (.25f * .5f + .5f)) { endValue = bezierValue + (.5f - amount); } else if (amount < (.25f * .5f + .75f)) { endValue = bezierValue + (.75f - amount); } else if (amount < 1f) { endValue = bezierValue + (1 - amount); } tweenValue.endValue = endValue; tweenValue.PlayForward(); EventDelegate.Add(tweenValue.onFinished, OnSpringFinish, true); }
void OnPressItem(GameObject go, bool state) { if (state) { for (int i = 0; i < transform.childCount; i++) { if (go.name == transform.GetChild(i).name) { checkItemAmount = .25f * i + bezierValue; } } checkItemAmount = IdentityBezierAmount(checkItemAmount); preBezierValue = bezierValue; isDragOut = false; isDrag = false; } else if (isDrag) { isDragOut = true; tweenValue = MUITweenValue.Begin(gameObject, .3f, 0f); tweenValue.CurveValue = bezierValue; tweenValue.startValue = bezierValue; if (preBezierValue > bezierValue) { tweenValue.endValue = bezierValue - Mathf.Abs(mDelta * 2); } else { tweenValue.endValue = bezierValue + Mathf.Abs(mDelta * 2); } tweenValue.PlayForward(); EventDelegate.Add(tweenValue.onFinished, OnTweenValueFinish, true); } }
public void PlayForward() { tween.PlayForward(); }