【Unity3D】DOTween共通機能
Dotween Common Function
DOTween公式文書: http://dotween.demigiant.com/documentation.php
- tweener.OnComplete()//アニメーションの最後にトリガーされます。
- トリガーが破壊されたときtweener.OnKill()//アニメーション。
- tweener.OnPlay()//アニメーションの開始時にトリガーされます。
- tweener.OnPause()//ムービーが一時停止されたときにトリガーされます。
- tweener.OnRewind()//アニメーションが逆再生されたときにトリガーされます。
- tweener.OnStart()//アニメーションの作成がトリガーされます。
- tweener.OnStepComplete()//単一のアニメーションループの終了をトリガーします。
- tweener.OnUpdate()//アニメーションが更新されたときにトリガーされます。
using UnityEngine using DG.Tweening // namespace introduced public class Shake : MonoBehaviour { private Tweener tweener void Start() { tweener = transform.DOShakePosition(2) tweener.OnStart (OnStart) // callback function tweener.OnUpdate (() => Debug.Log ( 'OnUpdate')) // use the callback function anonymous + tweener.onComplete + = OnComplete // use delegates inside tweener.OnKill (() => OnKill ( 'OnKill')) // need to pass parameters using a Lambda expression } void OnStart() { Debug.Log('OnStart') } void OnComplete() { Debug.Log('OnComplete') } void OnKill(string param) { Debug.Log(param) } }