04-28-2016, 08:16 AM
(04-21-2016, 09:49 PM)invadererik Wrote: I have a lot of splines, I don't ever move them, they are static. Why do they need to Update ?
Can there be a "No Update" mode ? I tried adding one, but then querying spline info does not
seem to work anymore.
I've added :
if (m_UpdateIn == CurvyUpdateMethod.NoUpdate)
doUpdate();
to the OnEnable call for CurvySpline.cs :
that seems to make it work, although would be better if it didn't have to refresh the spline OnEnable, just use the data from Editor, I'm going to keep on modding it. Is there a better way to just generate the spline and never update ?
OK I think this does it:
moved the code all the way to the top of the OnEnable() function:
if (m_UpdateIn == CurvyUpdateMethod.NoUpdate)
{
mIsInitialized = true;
doUpdate();
return;
}
This effectively makes the splines almost zero cost all the time. Not sure what effect it might have in the Editor, but
you can switch it back to Update when editing the splines and switch it back to NoUpdate once you are done.
Anyway I suggest this small change, should be added to next version !
Hey - many thanks for this. Made the change so see if I get any side effects
It might be useful for me when instantiating objects with splines from a pooling solution
cheers
Nalin