--運動曲線可視化網站? ? ? ? ? ?https://www.runoob.com/jqueryui/api-easings.html
--運動曲線借鑒網頁? ? ? ? ? ? ? ?https://blog.csdn.net/zcc858079762/article/details/81279828
--運動曲線示意? ? ? ? ? ? ? ? ? ? ? http://robertpenner.com/easing/easing_demo.html
--DoTween方法借鑒網頁? ? ? https://blog.csdn.net/quanfa206/article/details/79180535
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?https://blog.csdn.net/likendsl/article/details/50887689
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?https://blog.csdn.net/qq_41056203/article/details/80935304
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?https://blog.csdn.net/czhenya/article/details/78377587?utm_source=debugrun&utm_medium=referral
--DoTween方法組? ? ? ? ? ? ? ?
1.以DO開頭的方法:就是補間動畫的方法。例如:transform.DOMoveX(100,1)? (local為局部)
2.以Set開頭的方法:設置補間動畫的一些屬性。例如:myTween.SetLoops(4, LoopType.Yoyo)
3.以On開頭的方法:補間動畫的回調方法。例如:myTween.OnStart(myStartFunction)』
(1)
DOText("啊啊", 5)? ? ? ? ? ? ? ? ? ? ? ? ? --5秒逐字顯示完
DOScale(1, 5)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --5秒尺寸變到
DOColor(Color.red, 2)? ? ? ? ? ? ? ? ? ? ? --顏色變
DOFade(1, 3)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --透明
DOAnchorPos(Vector3,duration)
DOAnchorPosY(-265f, 0.5f);? --把Y軸移動到相對位置,花費多少時間
DOMove(Vector3(0,1,1),2)? ? ? ? ? ? ? ? ? ? --常用移動
DOMove(Vector3(0,1,1),2):SetRelative()? ? ? --移動加量
DOLocalMove(new Vector3(10, 10, 10), 5)?
DOMoveX(5, 3).From()? ? ? ? ? ? --From從目標點立即反向移動
DORotate(new Vector3(10, 10, 10), 5)?
DOLocalMoveX(5, 10)?
DOLocalRotate(new Vector3(10, 10, 10), 5)?
DOScaleX(5, 10)?
DOLookAt(new Vector3(10, 10, 10), 5)? ? ? ? --朝向目標點
DOComplete()? ? ? ? ? ? ? ? ? ? ? ? ? ? --移動立即結束(且動完)
DOKill()? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --停掉當前變化
DOPause()? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --暫停
DOPlay()? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --播放
DOFlip()? ? ? ? ? ? ? ? ? ? ? ? --僅在變化中,立即慢慢恢復原樣
DOTogglePause()? ? ? ? ? ? ? ? --僅在變化中,停止/開始
DOGoto(2)? ? ? ? ? ? ? ? ? ? --僅在變化中,物體變化到2秒時狀態
DOPlayBackwards()? ? ? ? ? ? --僅在變化中,物體回到原始位置(倒)
DOPlayForward()? ? ? ? ? ? ? ? ? ? ? ? ? ? --再次變化
DORewind()? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --回到原始(重置)
DORestart()? ? ? ? ? ? ? --僅在變化中,從頭播
DOJump(new Vector3(10, 10, 10), 3, 10)? ? --彈跳(點,次數,時間)
DOLocalJump(new Vector3(10, 10, 10), 3, 10)
DOPunchPosition(new Vector3(10, 10, 10), 5) --坐標回彈
DOPunchRotation(new Vector3(50, 50, 50), 5) --旋轉回彈
DOPunchScale(new Vector3(5, 5, 5), 5? ? ? ? --尺寸回彈
DOShakePosition(1,Vector3(3,3,0),10,90)? ? --時間和相機位移和震動次數和方向(震動)
DOShakePosition(10, new Vector3(10, 10, 10));
DOShakeRotation(10, new Vector3(10, 10, 10));
DOShakeScale(10, new Vector3(10, 10, 10));
--Blend動畫融合方法(兩次臨近動畫Dotween會跳過第一行,此時需要混合)
DOBlendableMoveBy(Vector3(0,1,1),2)? ? ? ? ? ? ? ? ? --移動加量(原有加參數)
DOBlendableLocalMoveBy(Vector3(10, 10, 10), 10)
DOBlendableRotateBy(new Vector3(30, 30, 30), 10)? ? ? --旋轉到
DOBlendableLocalRotateBy(new Vector3(30, 30, 30), 10)
DOBlendableScaleBy(new Vector3(10, 10, 10), 10)? ? ? --尺寸加量
(2)
SetAs(Tween tween \ TweenParams tweenParams)?
SetAutoKill(true)? ? ? ? --設置自動銷毀? /DOFade(0, 1.5f).SetAutoKill(false).Pause();
SetEase(Ease.OutBounce)? ? ? --動畫曲線(緩沖類型)
SetDelay(everyDelay)? ? ? ? ? --設置延遲
SetId(object id)? ? ? ? ? ? ? --設置ID? ? 可以只用int、string、object等類型的值
SetLoops(2, LoopType loopType = LoopType.Restart)? --動畫循環次數/類型 LoopType.Yoyo
SetRecyclable(bool recyclable)? ? ? ? ? ? ? ? ? ? --設置為可回收,可循環使用的
?SetUpdate(UpdateType updateType,false)? ? ? ? ? ? --是否忽視 Unity的時間影響
SetRelative()? 設置相對變化
(3)
OnComplete()? ? ? ? --綁定結束事件的函數
Onkill()? ? ? ? ? ? --動畫被銷毀的時候調用
OnPlay()? ? ? ? ? ? --動畫播放的時候調用
OnPause()? ? ? ? ? ? --動畫暫停的時候調用
OnRewind()? ? ? ? ? --動畫被重置的時候
OnStart()? ? ? ? ? ? --動畫被播放的時候(只會調用一次)
OnStepComplete()?
OnUpdate()? ? ? ? ? --每幀調用
OnWaypointChange()? ? ? ? ?
(other)
self.sequence = CS.DG.Tweening.DOTween.Sequence()? --一個個播? ?
local tween3 = self.goodItem.transform:DOScale(Vector3(1.1,1.1,1.1),0.1)
local tween4 = self.goodItem.transform:DOScale(Vector3(1,1,1),0.1)
self.sequence:Append(tween3)
self.sequence:Append(tween4)?
?//設置冷卻轉圈 附帶設置 轉一圈完成的回調方法(回調方法直接實現,不用調用其他的方法)
img.DOFillAmount(0, 1.5f).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo).OnStepComplete(() =>
{
? ? ? ? ? ?img.fillClockwise = !circleOutline.fillClockwise;
? ? ? ? ? ?img.DOColor(RandomColor(), 1.5f).SetEase(Ease.Linear);
}).Pause();