using FluffyUnderware.Curvy; using FluffyUnderware.Curvy.Controllers; using UnityEngine; public class SplineSwitcher : MonoBehaviour { public GameObject spline1; public GameObject spline2; public GameObject spline3; public GameObject spline4; public GameObject spline5; public GameObject spline6; public GameObject spline7; public int currentIndex = 1; public CurvySpline GetDefaultController() { return spline1.GetComponent(); } public CurvySpline Next() { if (currentIndex >= 7) return spline7.GetComponent(); currentIndex++; Clear(); switch (currentIndex) { case 2: spline2.SetActive(true); return spline2.GetComponent(); case 3: spline3.SetActive(true); return spline3.GetComponent(); case 4: spline4.SetActive(true); return spline4.GetComponent(); case 5: spline5.SetActive(true); return spline5.GetComponent(); case 6: spline6.SetActive(true); return spline6.GetComponent(); case 7: spline7.SetActive(true); return spline7.GetComponent(); default: break; } return spline1.GetComponent(); } private void Clear() { spline1.SetActive(false); spline2.SetActive(false); spline3.SetActive(false); spline4.SetActive(false); spline5.SetActive(false); spline6.SetActive(false); spline7.SetActive(false); } }