06-06-2016, 02:30 PM
(This post was last modified: 06-06-2016, 05:36 PM by Trainzland.)
I use the new Version 2.1.
On change the position of a ControlPoint Handle (Bezier) in EDITOR, it seems the internal cache points (pre calculated Approximation) are not updated. Calculating the all tf/dist on a spline are wrong for the first time. CheckTransForm is True.
A) Is there a command to the force update the internal info/cache/orientation to make the spline also Initialized=true?
B) Further I have another problem to position objects after pressing Stop in Editor.
By pressing Stop then OnValidate() is called to reposition the object to it's original position in my script.
But if OnValidate() is called, none of the splines are Initialized.
Waiting for all splines are initialised doesn't work in OnValidate() for any reason.
Is there any solution wait for spilnes are initialized after pressing stop in editor? (Script has not [ExecuteInEditMode])
Thanks
On change the position of a ControlPoint Handle (Bezier) in EDITOR, it seems the internal cache points (pre calculated Approximation) are not updated. Calculating the all tf/dist on a spline are wrong for the first time. CheckTransForm is True.
A) Is there a command to the force update the internal info/cache/orientation to make the spline also Initialized=true?
B) Further I have another problem to position objects after pressing Stop in Editor.
By pressing Stop then OnValidate() is called to reposition the object to it's original position in my script.
But if OnValidate() is called, none of the splines are Initialized.
Waiting for all splines are initialised doesn't work in OnValidate() for any reason.
Code:
Void OnValidate() {
WaitForInitSplines();
... resposition any stuff ........
}
IEnumerator WaitForInitSplines() {
Debug.Log("WaitForInitSplines()");
allSplinesInitialized = false;
AllSplines = FindObjectsOfType(typeof(CurvySpline)) as CurvySpline[];
foreach (var Spline in AllSplines) {
while (!Spline.IsInitialized) {
yield return null;
}
}
allSplinesInitialized = true;
}
Is there any solution wait for spilnes are initialized after pressing stop in editor? (Script has not [ExecuteInEditMode])
Thanks
(Henry Ford) Each hour more of searching is each hour less of your live time.