using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class Tween : MonoBehaviour
{
public Ease ease;
// Start is called before the first frame update
void Start()
{
// static DOTween.Init(bool recycleAllByDefault = false, bool useSafeMode = true, LogBehaviour logBehaviour = LogBehaviour.ErrorsOnly)
// Initializes DOTween.
DOTween.Init(false, true, LogBehaviour.ErrorsOnly);
// static DOTween.Sequence()
// Returns a usable Sequence which you can store and add tweens to.
Sequence mySeq = DOTween.Sequence();
// Delays and loops (when not infinite) will work even inside nested tweens.
// Append(Tween tween)
// Adds the given tween to the end of the Sequence.
mySeq.Append(transform.DOMove(new Vector3(5.0f, 0.0f, 5.0f), 2, false).SetEase(ease).SetLoops(3, LoopType.Yoyo));
mySeq.Append(transform.DOMove(new Vector3(-5.0f, 0.0f, 5.0f), 2, false).SetEase(ease).SetLoops(3, LoopType.Yoyo));
// 첫 번째 DOMove를 3회 반복, 그리고 두 번째 DOMove를 3회 반복 한다. 전체(첫 번째 + 두 번째) DOMove를 3회 반복하는게 아니다.
// Insert a lookat tween for the whole duration of the Sequence
// Insert(float atPosition, Tween tween)
// Inserts the given tween at the given time position, thus allowing you to overlap tweens instead of just placing them one after each other.
mySeq.Insert(0, transform.DOLookAt(new Vector3(0.0f, 0.0f, 0.0f), mySeq.Duration()));
// float Duration(bool includeLoops = true)
// Returns the duration of the tween(delays excluded, loops included if includeLoops is TRUE).
}
// Update is called once per frame
void Update()
{
}
}