DOTween開發文檔中文版

DOTween相比iTween,語法更優雅,效率更高,筆者將盡可能翻譯完DOTween的官方文檔。

Nomenclature(命名規則)

Tweener:A tween that takes control of a value and animates it.api

補間動畫:管理一個值並在這個值上建立動畫。app

Sequence:A special tween that, instead of taking control of a value, takes control of other tweens and animates them as a group.ide

序列:序列是特殊的補間動畫,它並無論理值,而是管理其餘的補間而且以一個羣組的方式建立補間集合的動畫。
函數

Tween:A generic word that indicates both a Tweener and a Sequence.oop

補間:一個籠統的單詞,既能夠表明補間動畫也能夠表明序列動畫

Nested tween:A tween contained inside a Sequence.this

嵌套補間:包含在序列中的補間url


Prefixes(前綴)

Prefixes are important to use the most out of IntelliSense, so try to remember these:spa

前綴幾乎是咱們在感官上識別如何準確使用的最重要的組成,因此請務必記住這些:翻譯

DO
Prefix for all tween shortcuts (operations that can be started directly from a known object, like a transform or a material). Also the prefix of the main DOTween class.
DO是全部補間快捷方式(對於快捷方式的含義咱們在下一部分會提到)的前綴 ,DO做爲前綴的補間能夠對一個已知的對象進行操做,好比transform對象或material對象。也是主要類 DOTween 前綴。咱們看如下的示例:
1 ransform.DOMoveX(100, 1);
2 transform.DORestart();
3 DOTween.Play();
Set
Prefix for all settings that can be chained to a tween (except for From, since it’s applied as a setting but is not really a setting).
對於一個補間咱們能夠還進行一些設置,這些設置咱們用Set做爲前綴(From卻沒有使用Set做前綴由於它以設置的方式使用真正設置) 
1 myTween.SetLoops(4, LoopType.Yoyo).SetSpeedBased();

 

On
Prefix for all callbacks that can be chained to a tween.
對於一個補間,咱們還能夠設置回調函數,這些回調函數用On做爲前綴。
1 myTween.OnStart(myStartFunction).OnComplete(myCompleteFunction);
相關文章
相關標籤/搜索