1.Kill杀死动画后,此时的动画的状态?传入参数的影响?
private Tweener cacheTweener;
public Transform obj;
public Vector3 OrVector3;
// Start is called before the first frame update
void Start()
{
OrVector3 = obj.position;
TweenAction();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A)) //直接出现在终点,并触发OnComplete
{
cacheTweener.Kill(true);
}
if (Input.GetKeyDown(KeyCode.R)) //动画播放完毕后 重置到播放
{
TweenAction();
}
if (Input.GetKeyDown(KeyCode.D)) //丢弃了对动画的缓存
{
cacheTweener = null;
}
if (Input.GetKeyDown(KeyCode.S)) //直接杀死动画 会停到中途 并且不会触发OnComplete
{
cacheTweener.Kill();
}
}
private void TweenAction()
{
obj.position = OrVector3;
cacheTweener = obj.DOMove(new Vector3(10, 10, 10), 10).OnComplete((() => Debug.Log(777777777777777)));
}