using UnityEngine;
using System.Collections;
using DG.Tweening;
public class GetStart : MonoBehaviour
{
public Vector3 myValue = new Vector3(, , );
public Transform tr;
bool isIn = false;
// Use this for initialization
void Start()
{
//DOTween.To(() => { return myValue; }, (x) => { myValue = x; }, new Vector3(10, 10, 10), 2);
//transform.DOMove(new Vector3(10, 10, 10), 2).OnComplete(()=>{
// transform.GetComponent<MeshRenderer>().material.DOColor(Color.green, 1);
//});
//DOTween.To(() => myValue, x => myValue = x, new Vector3(0, 0, 0), 1);
Tweener er = tr.DOLocalMove(new Vector3(, , ), 0.5f);
er.SetAutoKill(false);
er.Pause();
}
// Update is called once per frame
void Update()
{
//tr.position = myValue;
//tr.GetComponent<RectTransform>().localPosition = myValue;
//Tween t;
//t.SetAutoKill(false); //播放完不销毁
//tr.DOPlayForward();//回放,向前播放
//tr.DOPlayBackwards(); //向后播放
//t.Pause(); //暂停
//t.Play();//播放
//tr.DOPlay(); //也是播放。来播放对象上的动画,这个只会播放一次
}
public void btnClick()
{
if (!isIn)
{
//tr.DOPlay();
tr.DOPlayForward();
isIn = true;
}
else
{
isIn = false;
//tr.DOLocalMove(new Vector3(552, 0, 0), 0.5f);
tr.DOPlayBackwards();
}
}
}
DOTween官网