当前位置:网站首页>Unity dotween sequence animation replay problem.
Unity dotween sequence animation replay problem.
2022-07-03 07:54:00 【GaoZhenwen2】
I wanted to Sequence Repeats, , The general idea is as follows :
1. First create an empty Sequence object
Sequence Squence_detail_show;2. And then in star Assign this empty object to a Dotween Of sequence object , Set up autokill by false, And the animation pauses
Squence_detail_show = DOTween.Sequence();// Create an animation sequence object .
Squence_detail_show.AppendInterval(1f);
Squence_detail_show.Append(camara_transform.DOLocalMove(new Vector3(-0.6339f, 1.2872f, -0.0463f), 2f).OnKill(()=>print(" A child object is killed ")).SetAutoKill(false));// Lens displacement 1
Squence_detail_show.Append(jia2ju4_transform_1.DOLocalMove(new Vector3(5f, 1.95f, 0), 1)); // fixture 1 an ,
Squence_detail_show.Join(jia2ju4_transform_2.DOLocalMove(new Vector3(-2.14f, 1.95f, 3.88f), 1)); // fixture 2 an ,
Squence_detail_show.Join(jia2ju4_transform_3.DOLocalMove(new Vector3(-2.08f, 1.95f, -3.65f), 1)); // fixture 3 an ,
Squence_detail_show.AppendInterval(1f);
Squence_detail_show.Append(jia2ju4_transform_1.DOLocalMove(new Vector3(2.63f, 1.95f, 0), 1)); // Return the fixture to its original position ,
Squence_detail_show.Join(jia2ju4_transform_2.DOLocalMove(new Vector3(-1.22f, 1.95f, 2.29f), 1)); // Return the fixture to its original position ,
Squence_detail_show.Join(jia2ju4_transform_3.DOLocalMove(new Vector3(-1.27f, 1.95f, -2.24f), 1)); // Return the fixture to its original position ,
/ Incremental mode of rotation , Use this all in the future
Squence_detail_show.Append(jia2zuo4_transform.DOLocalRotate(new Vector3(720, 0, 0), 1).SetRelative(true).SetEase(Ease.Linear));// The clamping seat rotates ,
Squence_detail_show.AppendInterval(1f);
Squence_detail_show.Append(camara_transform.DOLocalMove(new Vector3(-0.636f, 1.3772f, -0.1404f), 2f));// Lens displacement 2
Squence_detail_show.Append(dao1ju4jia2zuo4_transform.DOLocalMove(new Vector3(0, 0, -5), 1).SetRelative(true)); // Upper tool Clamp seat
Squence_detail_show.Append(dao1ju4jia2zuo4_transform.DOLocalMove(new Vector3(0, 0, 5), 1).SetRelative(true)); // Upper tool Clamp seat , Return action
Squence_detail_show.Append(camara_transform.DOLocalMove(Vector3_camara_main, 2f));// Lens displacement Reset
Squence_detail_show.SetEase(Ease.Linear).SetAutoKill(false).Pause().OnComplete(()=>print(" Animation 1 Play finished ")).
OnPlay(()=>print(" Animation sequence 1 Playing ."))
;
3. Use one last click Event to trigger this sequence Playback of
public void Clickde() {
if (Squence_detail_show.IsPlaying()==true)
{
print(" Wait for the mottle to play .");
return;
}
else
{
print(" Click play ");
Squence_detail_show.Play();
Squence_detail_show.PlayForward();
}
The problem is , Animation can only be played once , Try your best not to let the animation play again , I don't know what the mechanism is .
5. The final solution is , You can only play the animation once and recreate one sequence 了 , Let these animations be automatically recycled by the system , That's about it , Every quilt click Trigger and recreate a sequence.
public void Clicked() {
sequence = DOTween.Sequence();
sequence.Append(transform.DOLocalMove(new Vector3(0, 0, 4), 1).OnPlay(()=>print(" Return to the original position .")));
sequence.Append(transform.DOLocalMove(new Vector3(6, 0, 4), 1));
sequence.Append(transform.DOLocalMove(new Vector3(2, 0, 6), 1));
}If you understand , I hope you can give me some advice .
边栏推荐
- Go language foundation ----- 13 ----- file
- 【LeetCode】2. Valid parentheses · valid parentheses
- Pat class a 1028 list sorting
- PHP微信抢红包的算法
- static关键字
- PAT甲级 1030 Travel Plan
- 2020-12-12
- Pat class a 1032 sharing
- PDO and SDO concepts
- Project experience sharing: Based on mindspore, the acoustic model is realized by using dfcnn and CTC loss function
猜你喜欢

Usage of requests module

【MySQL 12】MySQL 8.0.18 重新初始化

Go language foundation ----- 07 ----- method

MAE

Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition

Project experience sharing: handwritten Chinese character recognition based on Shengsi mindspire

【LeetCode】3. Merge two sorted lists · merge two ordered linked lists

vcs import src < ros2. Repos failed

多旅行商问题——公式和求解过程概述
![[step on the pit series] MySQL failed to modify the root password](/img/d0/f975baf18bac506208abff3713ac03.png)
[step on the pit series] MySQL failed to modify the root password
随机推荐
Go language foundation ----- 19 ----- context usage principle, interface, derived context (the multiplexing of select can be better understood here)
【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机
Static keyword
密西根大学张阳教授受聘中国上海交通大学客座教授(图)
experiment.........
华为S5700交换机初始化和配置SSH和TELNET远程登录方法
PAT甲级 1032 Sharing
idea取消引用显示效果
在浏览器输入url后执行什么
How does yarn link help developers debug NPM packages?
Go language foundation ----- 02 ----- basic data types and operators
Huawei s5700 switch initialization and configuration Telnet, SSH user methods
PDO and SDO concepts
Iterm2设置
static关键字
Technical dry goods | Bert model for the migration of mindspore NLP model - text matching task (2): training and evaluation
一个实习生的CnosDB之旅
[MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18
Redis配置文件
[at] ABC 258g - Triangle triples reachable - violence