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