DOTween開發文檔中文版


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

Nomenclature(命名規則)

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

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

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

序列:序列是特殊的補間動畫,它並不管理值,而是管理其他的補間並且以一個群組的方式創建補間集合的動畫。

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

補間:一個籠統的單詞,既可以代表補間動畫也可以代表序列

Nested tween:A tween contained inside a Sequence.

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


Prefixes(前綴)

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

前綴幾乎是我們在感官上識別如何准確使用的最重要的組成,所以請務必記住這些:

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);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM