public void UIDestroyAction(EventMultiArgs args) { _bg.alpha = 1f; TweenAlpha tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeOutTime, 0f); tAlpha.AddOnFinished(OnDestroyActoinComplete); }
public void ShoEnterPopBig() { TweenAlpha tweenAlpha = gameObject.AddMissingComponent <TweenAlpha>(); tweenAlpha.enabled = false; tweenAlpha.mTrans = gameObject.transform; tweenAlpha.value = 0; tweenAlpha = TweenAlpha.Begin(gameObject, 0.15f, 1); tweenAlpha.onFinished.Clear(); tweenAlpha.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenAlpha); TweenScale tweenScale = gameObject.AddMissingComponent <TweenScale>(); tweenScale.enabled = false; tweenScale.mTrans = gameObject.transform; AnimationCurve curve = new AnimationCurve(); Keyframe frame = new Keyframe(0, 0, 0, 0); Keyframe frame2 = new Keyframe(1, 1, 2, 2); curve.AddKey(frame); curve.AddKey(frame2); curve.postWrapMode = WrapMode.ClampForever; curve.preWrapMode = WrapMode.ClampForever; tweenScale.animationCurve = curve; tweenScale.value = Vector3.zero; tweenScale = TweenScale.Begin(gameObject, 0.15f, Vector3.one); tweenScale.onFinished.Clear(); tweenScale.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenScale); }
public void UICreateAction(EventMultiArgs args) { //渐显 TweenAlpha tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeInTime, 1f); tAlpha.AddOnFinished(OnCreateActoinComplete); }
void FadeOutOrFadeOutGraduallyShow() { if (excuteTimes >= times) { CancelInvoke("FadeOutOrFadeOutGraduallyShow"); } excuteTimes++; foreach (Transform item in transforms) { UISprite uISprite = item.GetComponent <UISprite>(); if (uISprite == null) { uISprite = item.gameObject.AddComponent <UISprite>(); } TweenAlpha tweenAlpha = uISprite.GetComponent <TweenAlpha>(); if (tweenAlpha == null) { tweenAlpha = uISprite.gameObject.AddComponent <TweenAlpha>(); } tweenAlpha.delay = delayTime; tweenAlpha.duration = internalTime; tweenAlpha.from = 1; tweenAlpha.to = 0; tweenAlpha.PlayForward(); tweenAlpha.AddOnFinished(() => { tweenAlpha.PlayReverse(); }); } }
public void UICreateAction(EventMultiArgs args) { ////渐显 _bg.alpha = 0f; TweenAlpha tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeInTime + 0.2f, 1f); tAlpha.AddOnFinished(_fadeInDel); //Invoke("OnCreateActoinComplete", _fadeInTime); }
public void UIDestroyAction(EventMultiArgs args) { _bg.alpha = 1f; tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeOutTime, 0f); tAlpha.RemoveOnFinished(_fadeInDel); tAlpha.AddOnFinished(_fadeOutDel); Invoke("OnDestroyActoinComplete", _fadeOutTime + 0.2f); }
/*TexAnimation开始alpha为0,*/ private void TweenAlphaAtStart(UITexture texAnimation) { TweenAlpha tween = TweenAlpha.Begin(texAnimation.gameObject, 0.1f, 1f); if (tween != null) { tween.delay = 0f; tween.AddOnFinished(OnTweenAlphaAtStartFinished); m_TweenAlphaOnStart = tween; } }
/// <summary> /// 隐藏牌,有过程 /// </summary> /// <param name="poker">要隐藏的牌</param> /// <param name="to">目标位置</param> /// <param name="onFinish">结束时回掉方法</param> public void HidePokerWithAnim(GameObject poker, Transform to = null, Action onFinish = null) { if (poker == null) { return; } PokerCard pCard = poker.GetComponent <PokerCard>(); pCard.SetCardId(0); pCard.SetCardFront(); if (to == null) { to = HideTran; } poker.transform.parent = to.transform; SpringPosition sp = poker.GetComponent <SpringPosition>(); sp.target = Vector3.zero; sp.enabled = true; TweenAlpha ta = poker.GetComponent <TweenAlpha>(); ta.from = 1; ta.to = 0; ta.duration = _runTime; ta.ResetToBeginning(); ta.PlayForward(); ta.AddOnFinished(onFinish != null ? new EventDelegate(() => { onFinish(); }) : new EventDelegate(() => { Destroy(poker); })); TweenRotation tr = poker.GetComponent <TweenRotation>(); tr.from = new Vector3(0, 0, -4); tr.to = Vector3.zero; tr.duration = _runTime; tr.ResetToBeginning(); tr.PlayForward(); TweenScale ts = poker.GetComponent <TweenScale>(); ts.from = poker.transform.localScale; ts.to = Vector3.one * 0.3f; ts.ResetToBeginning(); ts.PlayForward(); }
public void ShowExitFull() { TweenAlpha tweenAlpha = gameObject.AddMissingComponent <TweenAlpha>(); tweenAlpha.enabled = false; tweenAlpha.mTrans = gameObject.transform; // tweenAlpha.animationCurve = AnimationCurve.EaseInOut(); TweenAlpha tween = TweenAlpha.Begin(gameObject, 0.15f, 0); tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); }
public void ShowTipInfo(string str) { if (MyHead.LblTipInfo == null || str == "") { return; } MyHead.LblTipInfo.transform.parent.gameObject.SetActive(true); MyHead.LblTipInfo.text = str; m_tweenAlpha = TweenAlpha.Begin(MyHead.LblTipInfo.transform.parent.gameObject, 1.0f, 0); m_tweenAlpha.from = 1.0f; m_tweenAlpha.to = 0f; m_tweenAlpha.delay = 0.5f; m_tweenAlpha.AddOnFinished(ShowTipInfoEnd); }
public void PlayTweenAlpha(GameObject go, float from, float to, float time, EventDelegate.Callback callBack = null) { TweenAlpha ta = go.GetComponent <TweenAlpha>(); ta.from = from; ta.to = to; ta.duration = time; ta.ResetToBeginning(); if (callBack != null) { ta.AddOnFinished(callBack); } ta.PlayForward(); }
public void OpenLastTutorial() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown lastTutorialPanel.depth = 6500; lastTutorialPanel.get_gameObject().SetActive(true); lastTutorialButton.onClick.Clear(); TweenAlpha tweenAlpha = TweenAlpha.Begin(lastTutorialSprite.get_gameObject(), 0.3f, 1f); tweenAlpha.AddOnFinished(delegate { lastTutorialButton.onClick.Add(new EventDelegate(CloseLastTutorial)); }); }
public void CloseLastTutorial() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown TweenAlpha tweenAlpha = TweenAlpha.Begin(lastTutorialSprite.get_gameObject(), 0.3f, 0f); tweenAlpha.AddOnFinished(delegate { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!AppMain.isApplicationQuit) { Object.Destroy(this.get_gameObject()); } }); }
public void CloseAfterGacha2(Action onClose = null) { TweenAlpha ta = TweenAlpha.Begin(AfterGacha2Tutorial, 0.3f, 0f); if (onClose != null) { ta.AddOnFinished(delegate { Object.DestroyImmediate(ta); if (onClose != null) { onClose(); } }); } }
public void Close(int lineIndex = 0, Action onClose = null) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown TweenAlpha ta = TweenAlpha.Begin(root[lineIndex].get_gameObject(), 0.3f, 0f); if (onClose != null) { ta.AddOnFinished(delegate { Object.DestroyImmediate(ta); if (onClose != null) { onClose(); } }); } }
public static void HideTutorialWidget(UIWidget widget, Action onHided) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown TweenAlpha ta = TweenAlpha.Begin(widget.get_gameObject(), 0.2f, 0f); ta.onFinished.Clear(); ta.AddOnFinished(delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) widget.get_gameObject().SetActive(false); if (onHided != null) { onHided(); } Object.Destroy(ta); }); }
/// <summary> /// 播放点击动画 /// </summary> private void playTween() { //播放点击动画 TA.enabled = true; TA_num.enabled = true; TA.PlayForward(); TA_num.PlayForward(); TA.AddOnFinished(delegate() { TA.PlayReverse();//倒放 }); TA_num.AddOnFinished(delegate() { TA_num.PlayReverse();//倒放 }); }
public void OpenLastTutorial() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown if (lastTutorialAtlas != null) { lastTutorialPanel.get_gameObject().SetActive(true); lastTutorialSprite.get_gameObject().SetActive(true); lastTutorialSprite.atlas = lastTutorialAtlas; lastTutorialSprite.spriteName = "Tutorial_Matome"; lastTutorialButton.onClick.Clear(); TweenAlpha tweenAlpha = TweenAlpha.Begin(lastTutorialSprite.get_gameObject(), 0.3f, 1f); tweenAlpha.AddOnFinished(delegate { lastTutorialButton.onClick.Add(new EventDelegate(CloseLastTutorial)); }); } }
protected override void OnOpen(object param = null) { base.OnOpen(); SoundManager.Instance.Play(7); UILevelUpInitParam initParam = param as UILevelUpInitParam; if (initParam == null) { return; } mObject.alpha = 1.0f; mLevel.text = initParam.Level.ToString(); TweenAlpha tween = (TweenAlpha)TweenAlpha.Begin(mObject.gameObject, 0.5f, 0.0f); tween.AddOnFinished(onFinished); tween.PlayForward(); }
public void CloseLastTutorial() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown TweenAlpha ta = TweenAlpha.Begin(lastTutorialSprite.get_gameObject(), 0.3f, 0f); ta.AddOnFinished(delegate { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (lastTutorialAtlas != null) { Object.DestroyObject(lastTutorialAtlas); } Object.DestroyImmediate(ta); Object.DestroyImmediate(lastTutorialSprite.get_gameObject()); lastTutorialSprite = null; lastTutorialButton = null; lastTutorialAtlas = null; }); }
private void OpenUI() { if (mTweenAlpha == null) { mTweenAlpha = mDMono.GetComponent <TweenAlpha>(); } CloseUI(); if (mTweenAlpha != null) { if (mTweenAlpha.onFinished.Count == 0) { mTweenAlpha.AddOnFinished(delegate { RewardItem.mDMono.gameObject.CustomSetActive(true); }); } mTweenAlpha.ResetToBeginning(); mTweenAlpha.PlayForward(); } }
public void Close(int lineIndex = 0, Action onClose = null) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (AfterGacha2Tutorial.get_gameObject().get_activeSelf()) { CloseAfterGacha2(onClose); } TweenAlpha ta = TweenAlpha.Begin(root[lineIndex].get_gameObject(), 0.3f, 0f); if (onClose != null) { ta.AddOnFinished(delegate { Object.DestroyImmediate(ta); if (onClose != null) { onClose(); } }); } }
internal void FadeOut() { TweenAlpha tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeOutTime, 0f); tAlpha.AddOnFinished(FadeOutFinish); }
public void FadeIn(EventDelegate.Callback onFinish) { _tweenFadeIn.AddOnFinished(onFinish); _tweenFadeIn.PlayForward(); }
void PlayExitAnimation() { if (playingQueue.Count > 0) { readyPlaying.Enqueue(PlayExitAnimation); return; } if (ExitPosAnimation != null && ExitPosAnimation.Length > 0) { for (int i = 0; i < ExitPosAnimation.Length; ++i) { if (ExitPosAnimation[i] != null) { TweenPosition tween = TweenPosition.Begin(ExitPosAnimation[i].gameObject, exitPosDuration[i], exitPosTo[i]); tween.from = exitPosFrom[i]; tween.animationCurve = exitPosCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitScaleAnimation != null && ExitScaleAnimation.Length > 0) { for (int i = 0; i < ExitScaleAnimation.Length; ++i) { if (ExitScaleAnimation[i] != null) { TweenScale tween = TweenScale.Begin(ExitScaleAnimation[i].gameObject, exitScaleDuration[i], exitScaleTo[i]); tween.from = exitScaleFrom[i]; tween.animationCurve = exitScaleCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitAlphaAnimation != null && ExitAlphaAnimation.Length > 0) { for (int i = 0; i < ExitAlphaAnimation.Length; ++i) { if (ExitAlphaAnimation[i] != null) { TweenAlpha tween = TweenAlpha.Begin(ExitAlphaAnimation[i].gameObject, exitAlphaDuration[i], exitAlphaTo[i]); tween.from = exitAlphaFrom[i]; tween.animationCurve = exitAlphaCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitRotAnimation != null && ExitRotAnimation.Length > 0 && exitRotDuration != null && exitRotDuration.Length >= ExitRotAnimation.Length && exitRotTo != null && exitRotTo.Length >= ExitRotAnimation.Length) { for (int i = 0; i < ExitRotAnimation.Length; ++i) { if (ExitRotAnimation[i] != null) { TweenRotation tween = TweenRotation.Begin(ExitRotAnimation[i].gameObject, exitRotDuration[i], Quaternion.Euler(exitRotTo[i])); tween.from = exitRotFrom[i]; tween.animationCurve = exitRotCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (playingQueue.Count <= 0) { FinishExitAnimation(); } }
void PlayEnterAnimation() { if (playingQueue.Count > 0) { readyPlaying.Enqueue(PlayEnterAnimation); return; } playingQueue.Clear(); if (EnterPosAnimation != null && EnterPosAnimation.Length > 0 && enterPosDuration != null && enterPosDuration.Length >= EnterPosAnimation.Length && enterPosTo != null && enterPosTo.Length >= EnterPosAnimation.Length) { for (int i = 0; i < EnterPosAnimation.Length; ++i) { if (EnterPosAnimation[i] != null) { TweenPosition tween = TweenPosition.Begin(EnterPosAnimation[i].gameObject, enterPosDuration[i], enterPosTo[i]); tween.from = enterPosFrom[i]; tween.animationCurve = enterPosCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterScaleAnimation != null && EnterScaleAnimation.Length > 0 && enterScaleDuration != null && enterScaleDuration.Length >= EnterScaleAnimation.Length && enterScaleTo != null && enterScaleTo.Length >= EnterScaleAnimation.Length) { for (int i = 0; i < EnterScaleAnimation.Length; ++i) { if (EnterScaleAnimation[i] != null) { TweenScale tween = TweenScale.Begin(EnterScaleAnimation[i].gameObject, enterScaleDuration[i], enterScaleTo[i]); tween.from = enterScaleFrom[i]; tween.animationCurve = enterScaleCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterAlphaAnimation != null && EnterAlphaAnimation.Length > 0 && enterAlphaDuration != null && enterAlphaDuration.Length >= EnterAlphaAnimation.Length && enterAlphaTo != null && enterAlphaTo.Length >= EnterAlphaAnimation.Length) { for (int i = 0; i < EnterAlphaAnimation.Length; ++i) { if (EnterAlphaAnimation[i] != null) { TweenAlpha tween = TweenAlpha.Begin(EnterAlphaAnimation[i].gameObject, enterAlphaDuration[i], enterAlphaTo[i]); tween.from = enterAlphaFrom[i]; tween.animationCurve = enterAlphaCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterRotAnimation != null && EnterRotAnimation.Length > 0 && enterRotDuration != null && enterRotDuration.Length >= EnterRotAnimation.Length && enterRotTo != null && enterRotTo.Length >= EnterRotAnimation.Length) { for (int i = 0; i < EnterRotAnimation.Length; ++i) { if (EnterRotAnimation[i] != null) { TweenRotation tween = TweenRotation.Begin(EnterRotAnimation[i].gameObject, enterRotDuration[i], Quaternion.Euler(enterRotTo[i])); tween.from = enterRotFrom[i]; tween.animationCurve = enterRotCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } //当PlayingQueue为0时,表示没有Tween动画,需要直接退出,以保证之前的 UICamera.ProhibitUI = true 造成的UI锁屏 if (playingQueue.Count <= 0) { FinishEnterAnimation(); } }
private void ShowSelfDefinePop() { Transform gTransform = gameObject.transform; foreach (UITweener itemTweener in popTweeners) { if (itemTweener is TweenAlpha) { TweenAlpha itemAlpha = itemTweener as TweenAlpha;; TweenAlpha tweenAlpha = gameObject.AddMissingComponent <TweenAlpha>(); tweenAlpha.enabled = false; tweenAlpha.mTrans = gTransform; tweenAlpha = TweenAlpha.Begin(gameObject, itemAlpha.duration, itemAlpha.to); tweenAlpha.delay = itemAlpha.delay; tweenAlpha.duration = itemTweener.duration; tweenAlpha.animationCurve = itemTweener.animationCurve; tweenAlpha.from = itemAlpha.from; tweenAlpha.to = itemAlpha.to; tweenAlpha.onFinished.Clear(); tweenAlpha.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenAlpha); } else if (itemTweener is TweenPosition) { TweenPosition itemPosition = itemTweener as TweenPosition; TweenPosition tweenPosition = gameObject.AddMissingComponent <TweenPosition>(); tweenPosition.enabled = false; tweenPosition.mTrans = gTransform; tweenPosition = TweenPosition.Begin(gameObject, itemPosition.duration, itemPosition.to + gTransform.localPosition); tweenPosition.delay = itemPosition.delay; tweenPosition.duration = itemPosition.duration; tweenPosition.animationCurve = itemPosition.animationCurve; tweenPosition.from = itemPosition.from + gTransform.localPosition; tweenPosition.to = itemPosition.to + gTransform.localPosition; gTransform.localPosition = tweenPosition.from; tweenPosition.onFinished.Clear(); tweenPosition.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenPosition); } else if (itemTweener is TweenScale) { TweenScale itemScale = itemTweener as TweenScale; TweenScale tweenScale = gameObject.AddMissingComponent <TweenScale>(); tweenScale.enabled = false; tweenScale.mTrans = gTransform; tweenScale = TweenScale.Begin(gameObject, itemScale.duration, itemScale.to); tweenScale.delay = itemScale.delay; tweenScale.duration = itemScale.duration; tweenScale.animationCurve = itemScale.animationCurve; tweenScale.from = itemScale.from; tweenScale.to = itemScale.to; gTransform.localScale = tweenScale.from; // tweenScale.value = Vector3.zero; tweenScale.onFinished.Clear(); tweenScale.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenScale); } else { LogMgr.instance.Log(LogLevel.ERROR, LogTag.None, "devindzhang itemTweener is not case:" + itemTweener); } } }
// Use this for initialization void Start() { movTexture.loop = false; movTexture.Play(); startLogoTweenAlpha.AddOnFinished(this.StartLogoTweenFinished); }
internal void ShowLogo() { logoFadeOutTween.AddOnFinished(SplashScreenFinished); logoFadeOutTween.PlayReverse(); }