tvanim1.Set(0,0,360f);
lightAnim.GetChild(0).DOLocalRotate(tvanim1, 2f, RotateMode.FastBeyond360).SetLoops(-1,LoopType.Restart).SetEase(Ease.Linear);
tvanim1.Set(0,0,-360f);
lightAnim.GetChild(1).DOLocalRotate(tvanim1, 2f, RotateMode.FastBeyond360).SetLoops(-1,LoopType.Restart).SetEase(Ease.Linear);
- 360度无效是因为 DOLocalRotate第三个参数默认是RotateMode.Fast ,会忽略超过360的角度,然后就不会旋转,使用RotateMode,.FastBeyond360 是OK的。
- SetEase(Ease.Linear) 设置成线性速率,旋转速度均匀,否则会有停止前的减速
- tvanim1是一个New Vector3, 不在这里直接New 使用预先创建的临时tvanim1是因为 性能分析时发现New占用的时间太长,会导致创建动画时卡顿