/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); this._tween = null; } RectTransform transButton = this.button.transform as RectTransform; transButton.anchoredPosition3D = this._positionButton; transButton.sizeDelta = this._sizeButton; RectTransform transDropdown = this.dropdown.transform as RectTransform; transDropdown.offsetMin = this._offsetMinDropdown; transDropdown.offsetMax = this._offsetMaxDropdown; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; XHash hashButton = XHash.New.AddLeft(400f).AddY(-250f).AddRight(1680f).AddHeight(400f); XHash hashDropdown = XHash.New.AddLeft(2000f).AddRight(300f).AddTop(250f).AddBottom(790f); this._tween = XTween.ParallelTweens ( false, XTween.To(this.button, hashButton, data.time, data.Easing), XTween.To(this.dropdown, hashDropdown, data.time, data.Easing) ); this._tween.Play(); }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); } this.target3D.transform.localPosition = this._position3D; this.target3DSecond.transform.localPosition = this._position3DSecond; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; if (this._tween == null) { this._tween = XTween.ParallelTweens ( false, target3DSecond.ToPosition3D(-940f, -160f, -500f, data.time, data.Easing), target3D.ToPosition3D(200f, 70f, -1500f, data.time, data.Easing) ).SetLock().Play(); } else { this._tween.Play(0f); } }
private void PlayAnimation3(object sender, TappedRoutedEventArgs e) { Button bt = (Button)sender; bt.IsEnabled = false; double originX = targets_[2].X; double originY = targets_[2].Y; var tween = XTween.ParallelTweens( new XTween(targets_[2], "X", originX, cellWidth_ * 2, 2, XTween.Easing.EaseElasticOut), new XTween(targets_[2], "Y", originY, winRect_.Height / 2 - 100, 2, XTween.Easing.EaseElasticOut), new XTween(targets_[2], "ScaleX", 1, 5, 2, XTween.Easing.EaseElasticOut), new XTween(targets_[2], "ScaleY", 1, 5, 2, XTween.Easing.EaseElasticOut), new XTween(targets_[2], "Rotate", 0, 180, 2, XTween.Easing.EaseCubicOut) ); tween.OnCompleted += (sender_, e_) => { targets_[2].X = originX; targets_[2].Y = originY; targets_[2].ScaleX = 1; targets_[2].ScaleY = 1; targets_[2].Rotate = 0; bt.IsEnabled = true; }; tween.Play(); }
private void PlayAnimation4(object sender, TappedRoutedEventArgs e) { Button bt = (Button)sender; bt.IsEnabled = false; double originX = targets_[3].X; double originY = targets_[3].Y; XTween.SerialTweens( XTween.ParallelTweens( new XTween(targets_[3], null, 1, 5, 1, XTween.Easing.EaseBounceOut).SetProperties("ScaleX", "ScaleY"), new XTween(targets_[3], "X", originX, cellWidth_ * 2, 2, XTween.Easing.EaseElasticOut), new XTween(targets_[3], "Y", originY, winRect_.Height / 2 - 100, 2, XTween.Easing.EaseElasticOut) ), XTween.ParallelTweens( new XTween(targets_[3], null, 5, 1, 1, XTween.Easing.EaseBounceOut).SetProperties("ScaleX", "ScaleY"), new XTween(targets_[3], "Rotate", 0, 180, 1, XTween.Easing.EaseElasticOut) ).SetDelay(0.5), XTween.ParallelTweens( new XTween(targets_[3], "X", originX, 1, XTween.Easing.EaseBackOut), new XTween(targets_[3], "Y", originY, 1, XTween.Easing.EaseBackOut) ).SetDelay(0.5) ) .SetComplete((sender_, e_) => { bt.IsEnabled = true; }) .Play(); }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); this._tween = null; } this.target3D.transform.localPosition = this._position3D; this.target3DSecond.transform.localPosition = this._position3DSecond; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; this._tween = XTween.ParallelTweens ( false, XTween.To(this.target3DSecond, XHash.New.AddX(-940f).AddY(-160f).AddZ(-500f), data.time, data.Easing), XTween.To(this.target3D, XHash.New.AddX(200f).AddY(70f).AddZ(-1500f), data.time, data.Easing) ); this._tween.Play(); }