1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 01:36:05 +08:00
2017-06-02 02:31:46 +02:00

22 lines
458 B
C#

using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
public class ShakeExample : MonoBehaviour
{
public Transform target;
public Tween shakeTween;
void Start()
{
// Create the tween (using default values)
shakeTween = target.DOShakePosition(1.5f).SetAutoKill(false).Pause();
}
// Called by UI button
public void Shake()
{
shakeTween.Restart();
}
}