using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class PathManager : MonoBehaviour
{
    [SerializeField] private Transform pathParent1;

    public static PathManager Instance;

    private void Awake()
    {
        Instance = this;
    }

    public void StartPath(Transform trf)
    {
        Vector3[] pathArray = new Vector3[pathParent1.childCount];
        for (int i = 0; i < pathArray.Length; i++)
        {
            pathArray[i] = pathParent1.GetChild(i).position;
        }

        trf.DOPath(pathArray, 5f).SetLookAt(0.01f).SetLoops(-1, LoopType.Yoyo).SetEase(Ease.Linear);
    }

}
