Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assigning "OnControlPointReached" and "OnEndReached" values during runtime?
#2
TLDR
Code:
newVehicleFleet[i].GetComponent<SplineController>().OnControlPointReached.AddListenerOnce(yourEventListner)


Those events are of type CurvySplineMoveEvent, which inherits from UnityEvent, a events class provided by Unity. So you can treat them as any other Unity event, or use the functionalities provided by CurvySplineMoveEvent, like AddListenerOnce(...) that make sure that you don't have the same listner attached multiple times.

You have an example usage in one of the example scenes, TrainCarManager, in the setController method
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
RE: Assigning "OnControlPointReached" and "OnEndReached" values during runtime? - by _Aka_ - 03-06-2019, 11:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 2,566 04-08-2024, 03:26 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 5,447 02-24-2024, 10:43 AM
Last Post: _Aka_
Wink Modifying Splines at Runtime artsung 1 1,793 01-30-2024, 09:40 AM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 1,858 01-30-2024, 09:30 AM
Last Post: _Aka_

Forum Jump: