01-09-2021, 12:00 PM
Hello, I am struggling with adding an OnSwitch event to my Spline Controller via script.
what i tried :
what i tried :
Code:
private void Init()
{
CurvySplineMoveEvent curvySplineMoveEvent = new CurvySplineMoveEvent();
curvySplineMoveEvent.AddListener(OnSwitch);
controller = gameObject.AddComponent<SplineController>();
controller.OnSwitch = curvySplineMoveEvent;
}
private void OnSwitch(CurvySplineMoveEventArgs args)
{
Debug.Log("switch!");
}