11-27-2014, 11:47 AM
Hi Jake,
I am using CurvySpline to plot a character travel path.
Ie: When player touch the screen, the character will move to that location along the spline.
I wanted to avoid any in game memory allocation whenever possible.
Looking at the CurvySplineSegment.Add(CurvySplineSegment, bool), the first thing it does is new GameObject().
Do you have any suggestion what I can do to avoid that?
The distance the character can travel is limited.
So I can pre-allocate 10 or 20 control points at GameObject.Start().
When a spline is require, I just bring-in (or enable) the number of control points and set their position and up-vector.
When the character has reach his destination, I'll just reparent (or disable) the control points.
The game is targeted on mobile devices.
kimc.
I am using CurvySpline to plot a character travel path.
Ie: When player touch the screen, the character will move to that location along the spline.
I wanted to avoid any in game memory allocation whenever possible.
Looking at the CurvySplineSegment.Add(CurvySplineSegment, bool), the first thing it does is new GameObject().
Do you have any suggestion what I can do to avoid that?
The distance the character can travel is limited.
So I can pre-allocate 10 or 20 control points at GameObject.Start().
When a spline is require, I just bring-in (or enable) the number of control points and set their position and up-vector.
When the character has reach his destination, I'll just reparent (or disable) the control points.
The game is targeted on mobile devices.
kimc.