Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to modify Example 12 to work bi-directionally and more than 2 connected splines
#4
Hi

ConnectedControlPointsSelector is an abstract class, which means you can't instanciate it directly. You need to inherit from it. To inherit from an abstract class, you need to implement its abstract method, namely SelectConnectedControlPoint in this case. That method's parameter and goals are explained in the documentation.

In that method, you are free to do whatever you want, as long as it is doable with the method's inputs. So yes, you can reproduce exactly the preset connection handling logics (Current Spline, Random Spline, ...) from spline controller if you want to. It will not be by simply doing a copy/past, you will need to format the code to use the SelectConnectedControlPoint inputs.

The preset connection handling logics have their parameters, such as "Reject current spline". From the moment you don't use a preset connection handling logic, those parameters are not used anymore. That's why they disappear from the UI. So in your example of reproducing a preset handling logic via a ConnectedControlPointsSelector instance, you will need to have your own parameters.

An example of a custom logic would be to check the junction script associated with the current connection, and based on its boolean either choose the spline that is diverging or not.

I hope this helped
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: How to modify Example 12 to work bi-directionally and more than 2 connected splines - by _Aka_ - 11-29-2022, 06:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 1 2 11 hours ago
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  Using Unity's SplineContainer in Curvy Splines dlees9191 3 15 02-26-2024, 09:49 AM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_

Forum Jump: