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.sprite.color = this._color; this.camera3D.fieldOfView = this._defaultFieldOfView; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; if (this.container2D.activeSelf) { XObjectHash hash = XObjectHash.New.Add("r", 1f, 0.56f).Add("g", 1f, 0.83f); this._tween = XTween.To(hash, UpdateColor, data.time, data.Easing); this._tween.Play(); } else { XObjectHash hash = XObjectHash.New.Add("fieldOfView", 6f); this._tween = XTween.To <Camera>(this.camera3D, hash, data.time, data.Easing); this._tween.Play(); } }
private void StartXTween(GameObject target) { IAni ani = XTween.To(target, XHash.New.Position(0f, 0f, -400f), 1f, Elastic.easeOut); ani.OnComplete = Executor.New(() => _isBreak = true); ani.Play(); }
/************************************************************************ * 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(); }
static public int constructor(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); XTween o; if (argc == 1) { o = new XTween(); pushValue(l, true); pushValue(l, o); return(2); } else if (argc == 2) { DG.Tweening.Tween a1; checkType(l, 2, out a1); o = new XTween(a1); pushValue(l, true); pushValue(l, o); return(2); } return(error(l, "New object failed.")); } catch (Exception e) { return(error(l, e)); } }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); this._tween = null; } this.target2D.transform.localPosition = this._position2D; this.target3D.transform.localPosition = this._position3D; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; if (this.container2D.activeSelf) { this._tween = XTween.To(this.target2D, XHash.New.AddX(800f).AddY(300f), data.time, data.Easing); this._tween.Play(); } else { // this._tween = XTween.To(this.target3D, hash, data.time, data.Easing); // XObjectHash hash = XObjectHash.New.Add("fieldOfView", 6f); // this._tween = XTween.ValueTo<Camera>(this.camera3D,hash,data.time,data.Easing); // this._tween.OnComplete = Executor.New(() => this.StartCoroutine(this.Test())); // yield return this._tween.WaitForGotoAndPlay(0.2f); yield return(XTween.SerialTweens(false, this.target3D.To(XHash.New.Scale(300f, 100f, 400f), data.time), this.target3D.To(XHash.New.Position(200f, 50f, -1500f), data.time)).WaitForPlay()); // this.target3D.transform.DOLocalMove(new Vector3(200f,50f,-1500f), data.time).Play(); Debug.Log("Test"); } }
public static IXTween ToRotation2D(this GameObject gameObject, float z, float time, bool clockwise, IEasing easing = null, bool realTime = false) { XHash hash = XHash.New; hash.AddRotationZ(z, clockwise, 0); return(XTween.To(gameObject, hash, time, easing, realTime)); }
/************************************************************************ * 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.SerialTweens ( 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); } }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); this._tween = null; } this.target2D.transform.localPosition = this._position2D; this.target3D.transform.localPosition = this._position3D; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; if (this.container2D.activeSelf) { XHash hash = XHash.New.AddX(800f).AddY(300f) .AddControlPointX(-1300f, 550f).AddControlPointY(550f, -800f); this._tween = XTween.To(this.target2D, hash, data.time, data.Easing); this._tween.Play(); } else { XHash hash = XHash.New.AddX(200f).AddY(50f).AddZ(-1500f) .AddControlPointX(-1000f, 550f).AddControlPointY(550f, -300f); this._tween = XTween.To(this.target3D, hash, data.time, data.Easing); this._tween.Play(); } }
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(); }
/************************************************************************ * Getter & Setter Declaration * ************************************************************************/ /************************************************************************ * Initialize & Destroy Declaration * ************************************************************************/ /************************************************************************ * Life Cycle Method Declaration * ************************************************************************/ protected override IEnumerator StartExample() { XTween.Initialize(1000); #if PERFORMANCE_TEST LeanTween.init(1100); #endif yield return(null); this._position2D = this.target2D.transform.localPosition; this._position3D = this.target3D.transform.localPosition; }
static public int ForceInit(IntPtr l) { try { XTween self = (XTween)checkSelf(l); self.ForceInit(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_tween(IntPtr l) { try { XTween self = (XTween)checkSelf(l); pushValue(l, true); pushValue(l, self.tween); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int TogglePause(IntPtr l) { try { XTween self = (XTween)checkSelf(l); self.TogglePause(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int PlayBackwards(IntPtr l) { try { XTween self = (XTween)checkSelf(l); self.PlayBackwards(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int SmoothRewind(IntPtr l) { try { XTween self = (XTween)checkSelf(l); self.SmoothRewind(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { WaitForSeconds wait = new WaitForSeconds(0.1f); if (this._tween != null) { // this._tween.Stop(); // this._tween = null; } if (this.target3D != null) { this.target2D.transform.localPosition = this._position2D; // this.target3D.transform.localPosition = this._position3D; } yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; if (this.container2D.activeSelf) { this._tween = XTween.To(this.target2D, XHash.New.AddX(800f).AddY(300f), data.time, data.Easing); this._tween.Play(); } else { IEasing ease = Ease.ElasticOut; yield return(wait); if (this._tween == null) { this._tween = target3D.ToPosition3D(200, 50, -1500, 3f).SetLock().SetReverse().SetRepeat(2).SetScale(2f).SetDelay(0.5f, 1f); this._tween.AddOnStop(() => Debug.Log("Stop")); this.isPlay = true; yield return(this._tween.WaitForPlay()); } else { if (isPlay) { isPlay = false; this._tween.Stop(); } else { isPlay = true; yield return(this._tween.WaitForPlay()); } } this.StartXTween(this.target3D); } }
static public int ElapsedDirectionalPercentage(IntPtr l) { try { XTween self = (XTween)checkSelf(l); var ret = self.ElapsedDirectionalPercentage(); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int Loops(IntPtr l) { try { XTween self = (XTween)checkSelf(l); var ret = self.Loops(); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
public static IXTween ToPosition2D(this Transform trans, float?x, float?y, float time, IEasing easing = null, bool realTime = false) { XHash hash = XHash.New; if (x != null) { hash.X = (float)x; } if (y != null) { hash.Y = (float)y; } return(XTween.To(trans.gameObject, hash, time, easing, realTime)); }
static public int Rewind(IntPtr l) { try { XTween self = (XTween)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); self.Rewind(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public static IXTween ToScale2D(this GameObject gameObject, float?x, float?y, float time, IEasing easing = null, bool realTime = false) { XHash hash = XHash.New; if (x != null) { hash.ScaleX = (float)x; } if (y != null) { hash.ScaleY = (float)y; } return(XTween.To(gameObject, hash, time, easing, realTime)); }
static public int set_tween(IntPtr l) { try { XTween self = (XTween)checkSelf(l); DG.Tweening.Tween v; checkType(l, 2, out v); self.tween = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int SetId(IntPtr l) { try { XTween self = (XTween)checkSelf(l); System.Object a1; checkType(l, 2, out a1); var ret = self.SetId(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
private void PlayAnimation1(object sender, TappedRoutedEventArgs e) { Button bt = (Button)sender; bt.IsEnabled = false; double originWidth = Target1.Width; var tween = new XTween(Target1, "Width", originWidth, cellWidth_ - 20, 2, XTween.Easing.EaseExpoInOut); tween.OnCompleted += (sender_, e_) => { Target1.Width = originWidth; bt.IsEnabled = true; }; tween.Play(); }
static public int ElapsedPercentage(IntPtr l) { try { XTween self = (XTween)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); var ret = self.ElapsedPercentage(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int OnWaypointChange(IntPtr l) { try { XTween self = (XTween)checkSelf(l); SLua.LuaFunction a1; checkType(l, 2, out a1); var ret = self.OnWaypointChange(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
/************************************************************************ * Coroutine Declaration * ************************************************************************/ protected override IEnumerator CoroutineStart() { if (this._tween != null) { this._tween.Stop(); this._tween = null; } this.sprite.color = this._color; yield return(new WaitForSeconds(0.5f)); TweenUIData data = this.uiContainer.Data; XColorHash hash = XColorHash.New.AddRed(0.56f).AddGreen(0.83f).AddAlpha(1f); this._tween = XTween.To(sprite, hash, data.time, data.Easing); this._tween.Play(); }
static public int GotoWaypoint(IntPtr l) { try { XTween self = (XTween)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); self.GotoWaypoint(a1, a2); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int SetUpdate(IntPtr l) { try { XTween self = (XTween)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); var ret = self.SetUpdate(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }