DoTween
来源:互联网 发布:淘宝店铺第三方 编辑:程序博客网 时间:2024/06/11 14:26
用了几天DoTween,发表一下见解!
DoTween相比于ITween确实方便了许多,执行效率也高,可是我感觉对于新手来说ITween更容易上手,不是说DoTween比较难学,而是官方文档太含糊了!没ITween的简洁明了!
举个例子吧!之前使用DoTweenPath的时候想在中途改变速度,可是很鸡肋,DoTween的一切都是动画执行之前设置好的!查遍了官方文档也找不出办法!最后在GitHub上发现有人说了句TimeScale,我累个擦!官方完全没给我说好吧?还是我没看见?
而且DoTween在网上的介绍大部分都是一个小小示例!完全应用不到使用中,不是把这个物体移动到那就是移动到这!放大缩小!简简单单的~假如我要一个物体向另一个移动的物体移动怎么办?(我也没找到好的办法,知道的人麻烦分享一下)!
不过!为了学习还是继续用用吧!大家有问题可以交流!
补充:终于!还是找到了解决方案!一款插件的强大不在于你会不会用!而是他本身就很强大!下面贴出从GitHub找出的代码!GItHub真心强大,比百度搜出来的有用多了!闭关锁国啊!
public class Follow : MonoBehaviour
{
public Transform target; // Target to follow
Vector3 targetLastPos;
Tweener tween;
void Start()
{
// First create the "move to target" tween and store it as a Tweener.
// In this case I'm also setting autoKill to FALSE so the tween can go on forever
// (otherwise it will stop executing if it reaches the target)
tween = transform.DOMove(target.position, 2).SetAutoKill(false);
// Store the target's last position, so it can be used to know if it changes
// (to prevent changing the tween if nothing actually changes)
targetLastPos = target.position;
}
void Update()
{
// Use an Update routine to change the tween's endValue each frame
// so that it updates to the target's position if that changed
if (targetLastPos == target.position) return;
// Add a Restart in the end, so that if the tween was completed it will play again
tween.ChangeEndValue(target.position, true).Restart();
targetLastPos = target.position;
}
}
- DoTween
- Dotween
- DoTween
- DoTween
- DoTween
- DoTween
- DOTween
- DOTween 使用方法
- DoTween动画
- DOTween教程
- DoTween使用方法
- Unity3D-DoTween
- DoTween - Sequence
- DOTween -Init
- DOTWeen使用方法
- DOTween教程
- DOTween实例
- DoTween插件
- Linux配置多tomcat
- Mysql开启远程连接方法
- Android开发艺术探索<Drawable系列之二ShapeDrawable>
- uva 10815 小紫<set>
- Java 8 中 Date与LocalDateTime、LocalDate、LocalTime互转
- DoTween
- A hard puzzle
- ROS图像相关包
- 约翰·卡马克和他的id Software
- 编译器设计:整型立即数支持
- Reorder List ---LeetCode
- php取周的第一天和最后一天
- C语言双重置换加密
- java 初探(五)