10-02-2020, 12:36 PM
Here is an example:
Add this method to a script (whatever it is), and then select an instance of that script as the object for your On Control Point Reached event, then select the method above.
You can see an example of usage of that event in TrainCarManager.cs, used in the scene 12 to handle the train junction.
If this explanation is not enough, please read this part of Unity's manual: https://docs.unity3d.com/Manual/UnityEvents.html
Code:
public void OnCPReached(CurvySplineMoveEventArgs e)
{
if (e.Spline.GetControlPointIndex(e.ControlPoint) == 2)
e.Sender.Speed = 10;
}Add this method to a script (whatever it is), and then select an instance of that script as the object for your On Control Point Reached event, then select the method above.
You can see an example of usage of that event in TrainCarManager.cs, used in the scene 12 to handle the train junction.
If this explanation is not enough, please read this part of Unity's manual: https://docs.unity3d.com/Manual/UnityEvents.html
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Please consider leaving a review for Curvy, this helps immensely. Thank you.

