09-27-2024, 08:34 AM
Hi,
I have a problem with my generator. I made a EditorWindow script for generating platforms in my game. I want to generate two signs facing the direction of the spline at the beginning and the ending of it.
I use Volume Spots to set both of them. I set its SpaceBefore at 0.25 so it will be right begind the beginning.
With the second one I came up with idea of using spline.Lenght to figure out what to set at SpaceAfter. Of course for safety I set it with x - 1 value.
After that i used bunch of .Refresh() metods of any different kind of noods: (Generator, InputPath, InputPath.Spline, VolumeSpots, CreateGO), but couldn't make it update at sceen, without manualy changing the position of ControlPoint of path spline to "refresh it" and Undoing it. Then it works just fine.
The metod im using goes like this:
Can someone suggest what to use to make it updating after using this method?
I have a problem with my generator. I made a EditorWindow script for generating platforms in my game. I want to generate two signs facing the direction of the spline at the beginning and the ending of it.
I use Volume Spots to set both of them. I set its SpaceBefore at 0.25 so it will be right begind the beginning.
With the second one I came up with idea of using spline.Lenght to figure out what to set at SpaceAfter. Of course for safety I set it with x - 1 value.
After that i used bunch of .Refresh() metods of any different kind of noods: (Generator, InputPath, InputPath.Spline, VolumeSpots, CreateGO), but couldn't make it update at sceen, without manualy changing the position of ControlPoint of path spline to "refresh it" and Undoing it. Then it works just fine.
The metod im using goes like this:
Code:
private void AlignSigns()
{
splineLenght = splineToGetLenght.Spline.Length - 1f;
signsVolumeSpots.Groups[0].SpaceAfter = new FloatRegion(splineLenght);
}
Can someone suggest what to use to make it updating after using this method?