1234567891011121314151617181920212223242526 |
- using DG.Tweening;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TestMove : MonoBehaviour
- {
- public List<Transform> list_point;
- public Transform Player;
- private float times = 0;
- private int Index = 0;
- private void Update()
- {
- times += Time.deltaTime;
- if(times>2)
- {
- times = 0;
- Player.DOMove(list_point[Index].position, 1.5f);
- // Player.position = list_point[Index].position;
- Index++;
- Index = Index % list_point.Count;
- }
- }
- }
|