【Unity3D】DOTween共通機能



Dotween Common Function



DOTween公式文書: http://dotween.demigiant.com/documentation.php

  1. tweener.OnComplete()//アニメーションの最後にトリガーされます。
  2. トリガーが破壊されたときtweener.OnKill()//アニメーション。
  3. tweener.OnPlay()//アニメーションの開始時にトリガーされます。
  4. tweener.OnPause()//ムービーが一時停止されたときにトリガーされます。
  5. tweener.OnRewind()//アニメーションが逆再生されたときにトリガーされます。
  6. tweener.OnStart()//アニメーションの作成がトリガーされます。
  7. tweener.OnStepComplete()//単一のアニメーションループの終了をトリガーします。
  8. 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) } }