当前位置:网站首页>Dotween plug-in
Dotween plug-in
2022-07-03 08:06:00 【Luckyᕙ(⇀‸↼‵‵)ᕗ】
1、 Import plug-ins
Click on Setup DoTween
2、 Commonly used API Introduce
Using this plug-in requires reference using DG.Tweening;
Common methods :
1、 With DO Opening method : Methods of making up animation . for example :Transform.DOMoveX(10,1)
2、 With Set Opening method : Set the properties of the make-up animation . for example :Tweener.SetLoops(4, LoopType.Yoyo)
3、 With On Opening method : Callback function of make-up animation . for example :Tweener.OnStart(callBackFunction)
- DOMove() What moves is the world coordinates of the object
DOMoveX() Only in X Moving in the direction of the axis ,DOMoveY(),DOMoveZ() Empathy
Case study 7: The camera vibrates continuously 5 second
Camera.main.transform.DOShakePosition(5, 0.5f);
- Sequence: Equivalent to one Tweener The linked list of , You can execute a Sequence To execute a series of Tweener,
Use Sequence Classes can be easily organized Tweens To make complex transition animation .
Sequence quence = DOTween.Sequence();
1) Add animation to the queue
quence.Append(transform.DOMove(Vector3.one, 2));
2) Add time interval
quence.AppendInterval(1);
3) Insert animation by point in time
The first parameter is time , This method inserts the animation into the specified time point
Take this sentence as an example , It is the DORotate Animation added to this queue 0 Seconds , Although it was not first added to the queue
quence.Insert(0, transform.DORotate(new Vector3(0, 90, 0), 1));
4) Add the current animation
Join Will join and let the animation execute together with the currently executing animation
Here are two lines of code ,DOMove Hui He DOScale Do it together
quence.Append(transform.DOScale(new Vector3(2, 2, 2), 2));
quence.Join(transform.DOMove(Vector3.zero, 2));
5) Pre add animation
Pre add will add animation directly to Append In front of , That is, at the beginning
quence.Prepend(transform.DOScale(Vector3.one * 0.5f, 1));
6) Pre add interval
quence.PrependInterval(1);
- Visual editing
DOTween Animation Components , Visualize and quickly animate
AutoPlay —— Auto play
AutoKill —— Automatically delete
Duration —— The duration of the
Ignorer TimeScale —— Ignore TimeScale Influence
Ease —— slow down ( Animation curve : Enumeration type )
loops —— cycles
ID —— The animation ID Mark ( adopt ID, Control directly with code )
TO —— Get to the target position ( You can click , Set up Form)
Snapping —— strong / Break suddenly
Relative —— Relative
Events —— event
OnStart —— initialization ( Only in the first run )
OnPlay —— Operation starts ( Each run starts )
OnUpdate —— Run every frame
OnStep —— Each step ( Every step in the operation )
OnComplete —— After the animation, it is called
using DG.Tweening;
public class PlayTest : MonoBehaviour {
DOTweenAnimation dat;
bool flag = false;
void Start () {
dat = GetComponent<DOTweenAnimation>();
}
public void Play ()
{
if (flag)
{
dat.DOPlayBackwards();
flag = false;
}
else
{
dat.DOPlayForward();
flag = true;
}
}
}
- Path editor
Add the component DOTweenPath
Add path points , The effect is as follows
Shift + Ctrl : Add path points
Shift + Alt : Delete path point
Ease : Animation curve type
Pathtype : Path type , Path types are linear or utilization CatmullRom Curve formed by interpolation algorithm Pathmode : Path mode , It is mainly used to restrict the rotation of the object in three directions .
ClosePath : Closed path , If this attribute is checked, the path will form a closed loop .
LocalMovement : Partial movement , If this attribute is checked, it will move according to the local coordinates .
Orientation : Movement orientation , It is divided into ToPath Towards the route ,LookAtTransform toward Transform,LookatPosition Towards the point .
LookAhead : Forward looking , The greater the numerical , Towards the point closer and more forward .
Relative : Indicates whether the path point is relative to the object , After checking , Moving objects , You can move the path together
边栏推荐
- freetype库的移植
- Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
- Conversion between JSON and object
- Editor Extensions
- Microsoft Security Response Center
- 链式长取值
- Unity change default editor
- How does yarn link help developers debug NPM packages?
- The general trend of data news releases the power of visual reporting ----- essays after reading
- About Wireshark's unsuccessful installation of npcap
猜你喜欢
Three characteristics
Iterm2 setting
[set theory] order relation (hastu example | divisive relation hastu | inclusive relation hastu | refinement relation hastu)
What to do after the browser enters the URL
vcs import src < ros2. Repos failed
Xlua task list youyou
LwIP learning socket (application)
Editor Extensions
Lua framwrok framework starts
C语言-入门-精华版-带你走进编程(一)
随机推荐
A tunnel to all ports of the server
【cocos creator】获取资源uuid
2020-12-12
[at] abc 258G - Triangle 三元組可達-暴力
Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!
Huawei s5700 switch initialization and configuration Telnet, SSH user methods
Unity XR realizes interaction (grasping, moving, rotating, transmitting, shooting) -pico
Usage of (case, when) in PostgreSQL
Quality blog——
unity2019_ Input management
How to configure GDAL under idea
[set theory] order relation (hastu example | divisive relation hastu | inclusive relation hastu | refinement relation hastu)
vcs import src < ros2. Repos failed
JS to implement publish and subscribe
the installer has encountered an unexpected error installing this package
[end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
How to establish rectangular coordinate system in space
RM delete file
P2622 关灯问题II(状态压缩 搜索)
P2704 [noi2001] artillery position (shape pressure DP)