유니티 C# 라인 따라가기 Follow Line


유니티 C# 라인 따라가기 Follow Line

코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class FollowLine : MonoBehaviour { public Transform[] Points; public IEnumerator GetPathEnumerator() { if (Points == null || Points.Length < 1) yield break; var direction = 1; var index = 0; while (true) { yield return Points[index]; if (index = Points.Length - 1) direction = -1; index = index + direction..


원문링크 : 유니티 C# 라인 따라가기 Follow Line