We all know that the Ngui with the ease (Tween), when I first use, I can only let him ease 1 times. There's a uiplaytween that can help you run tween multiple times. Of course, you can use Dotween, Itween and other professional third-party easing plug-ins. This article only explains: Ngui's tween
First, some simple explanations for chestnuts are:
Mainly for the "target go" displacement operation
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/87/10/wKiom1fSbETSDRE0AAMAkXumG7w628.png-wh_500x0-wm_3 -wmp_4-s_1949583699.png "title=" 01.png "alt=" Wkiom1fsbetsdre0aamakxumg7w628.png-wh_50 "/>
For "target go" needs to be mounted: tweenposition, Uiplaytween, and one of my own scripts: Testtweenpos (as long as the Operation Tweenposition,uiplaytween)
About: tweenposition:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/87/10/wKiom1fSbfPz2s0YAACNM-D08eQ687.png-wh_500x0-wm_3 -wmp_4-s_3917462954.png "title=" 02.png "alt=" Wkiom1fsbfpz2s0yaacnm-d08eq687.png-wh_50 "/>
About Uiplaytween:
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/87/10/wKiom1fSbt3CQ5VZAACJ6A3tjow362.png-wh_500x0-wm_3 -wmp_4-s_2774083835.png "title=" 03.png "alt=" Wkiom1fsbt3cq5vzaacj6a3tjow362.png-wh_50 "/>
About Testtweenpos:
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/87/10/wKiom1fSb22wHkbMAAA9o1-R78c424.png-wh_500x0-wm_3 -wmp_4-s_2694536447.png "title=" 04.png "alt=" Wkiom1fsb22whkbmaaa9o1-r78c424.png-wh_50 "/>
There are 2 parameters: Tweenposition and Uiplaytween, respectively.
On the testtweenpos code:
using unityengine;using system.collections;public class testtweenpos : monobehaviour {// use this for initialization public tweenposition _tweenpos; public uiplaytween _playtween; private bool _isRe = false;void Start () {}// Update is called once per framevoid update () {} public void starttween ( Vector2 _location ) { if ( !THIS._ISRE) { this._tweenPos.from = new Vector3 (this.gameobject.transform.localposition.x, this.gameobject.transform.localposition.y, 0); this._tweenpos.to = new vector3 (_location.x, _location.y, 0.0f); } else { this._tweenpos.to = new vector3 (this.gameobject.transform.localposition.x, this.gameobject.transform.localposition.y, 0); this._tweenpos.from = new vector3 (_location.x, _location.y, 0.0f); } this._isre = !this._isre; this._playtween.play (True); }}
This Uiplaytween "Toggle", it is the meaning of the switch (click from the Run to the to, at the point from the to run to the from, and then from the run to to), if you need to tweenposition continuous operation, it will need to change the real-time (exchange ) The From and to values.
This article is from the "Better_power_wisdom" blog, make sure to keep this source http://aonaufly.blog.51cto.com/3554853/1851152
Unity NGUI TWEEN