01-18-2020, 10:01 PM
Yep, in hell until Wednesday. Then I will be in purgatory (installing everything on my new pc) for some time.
- I have no environnement to test in, but here is my guess of the code you need:
Code:var selectedControllers =Selection.transforms.Select(t => t.gameObject.GetComponent<SplineController>()).Where(c=> c != null).ToList();
if(selectedControllers.Count > 1)
{
//your stuff
} - As far as I know you can't tell Unity to do special operations when updating a value from multiple selected objects in the inspector
- I think the easiest is to just create a new script with a position slider, and when the values is modified (see OnValidate above) execute you code that will get all the selected controllers and modify their positions accordingly
- You can simple convert the value of the position slider I spoke about in point 3 from the 0;1 range to another range, before assigning the value to the controllers, to make sure that all controllers stay in their valide range
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.