using System; using System.Collections.Generic; using UnityEngine; namespace Core.Utility { public class BesselPathMono : MonoBehaviour { public Transform[] Transforms; public BesselPath BesselPath; private void OnDrawGizmos() { if (BesselPath == null) { BesselPath = new BesselPath(); } if (Transforms == null || Transforms.Length < 2) { return; } List pos = new List(); for (int i = 0; i < Transforms.Length; i++) { pos.Add(Transforms[i].position); } BesselPath.SetPos(pos); float bl = 1.0f / 300; for (float i = 0; i < 300 - 1; i++) { Vector3 pos1 = BesselPath.GetValue(i * bl); Vector3 pos2 = BesselPath.GetValue((i + 1) * bl); Debug.DrawLine(pos1, pos2, Color.red); } } } }