03-12-2019, 12:00 PM
Hi,
1- Splines' control points coordinates are in the local space of the spline. So by using the same local position, and changing the spline's transform, you can have synchronized splines with different scales, rotations and positions. I attached a scene and script doing this. In my script I synchronize only the the control point's positions. I assume that both your splines have already the right setup (the same interpolation type for example), and that you don't modify the handles. If that assumption is false, you can easily add to my script the code that will synchronize the needed properties.
2- You will need to write the code for a simplified runtime editor. I bet there are on the store some assets that already do that. Control points being GameObjects, anything on the store that allows you to move game objects at runtime will do the trick here.
3- Yes, you can have multiple meshes with multiple materials on the same spline. I added to the attached scene a "TubeSetuper" that does that with two materials. You can then enhance that script to handle whatever number of tubes you need.
Keep in mind that both the scripts are just proof of concept, so they are definitely not be the most optimized and error resilient scripts you can get.
Let me know if you still have any other question
Have a nice day
1- Splines' control points coordinates are in the local space of the spline. So by using the same local position, and changing the spline's transform, you can have synchronized splines with different scales, rotations and positions. I attached a scene and script doing this. In my script I synchronize only the the control point's positions. I assume that both your splines have already the right setup (the same interpolation type for example), and that you don't modify the handles. If that assumption is false, you can easily add to my script the code that will synchronize the needed properties.
2- You will need to write the code for a simplified runtime editor. I bet there are on the store some assets that already do that. Control points being GameObjects, anything on the store that allows you to move game objects at runtime will do the trick here.
3- Yes, you can have multiple meshes with multiple materials on the same spline. I added to the attached scene a "TubeSetuper" that does that with two materials. You can then enhance that script to handle whatever number of tubes you need.
Keep in mind that both the scripts are just proof of concept, so they are definitely not be the most optimized and error resilient scripts you can get.
Let me know if you still have any other question
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.