当前位置:网站首页>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 .
边栏推荐
- Quality blog——
- Enter three times and guess a number
- Redis batch startup and shutdown script
- Go language foundation ------ 14 ------ gotest
- 【MySQL 13】安装MySQL后第一次修改密码,可以可跳过MySQL密码验证进行登录
- When did you find out that youth was over
- Go language foundation ----- 11 ----- regular expression
- 创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
- PAT甲级 1031 Hello World for U
- Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
猜你喜欢
【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机
vcs import src < ros2. Repos failed
haproxy+keepalived搭建01
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
Go language foundation ----- 01 ----- go language features
Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing
[MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18
Pat class a 1030 travel plan
Oracle queries grouped by time
An intern's journey to cnosdb
随机推荐
The difference between hdmi2.1 and hdmi2.0 and the conversion of PD signals.
Redis配置文件
Quality blog——
LwIP learning socket (application)
[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
idea取消引用显示效果
微软安全响应中心
【LeetCode】3. Merge Two Sorted Lists·合并两个有序链表
Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
OSPF protocol summary
Technology dry goods | Roberta of the migration of mindspore NLP model - emotion analysis task
Go language foundation ----- 16 ----- goroutine, GPM model
How to configure GDAL under idea
[MySQL 14] use dbeaver tool to remotely backup and restore MySQL database (Linux Environment)
Go language foundation ----- 01 ----- go language features
Technical dry goods | alphafold/ rosettafold open source reproduction (2) - alphafold process analysis and training Construction
PHP wechat red packet grabbing algorithm
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
[at] abc 258G - Triangle 三元组可达-暴力
Pat class a 1031 Hello world for u