static public int RepeatCall(float timeInterval, RepeatCallAction callOnUpdate)
{
Action at = null;
int id = 0;
LTDescr descr = null;
at = () =>
{
if (!callOnUpdate())
{
LeanTween.cancel(id);
descr = null;
at = null;
}
else
{
if (descr.loopCount <= 1)
{
descr.setLoopCount(int.MaxValue - 1);
}
}
};
descr = LeanTween.delayedCall(timeInterval, at).setRepeat(int.MaxValue - 1);
id = descr.id;
return(id);
}