void onTweenEnded(Entity e, TweenComponent tweenComponent, Tween tween) { e.AddCallOnFrameEnd((ent) => { tweenComponent.RemoveTween(tween); if (tweenComponent.tweens.Count == 0) e.RemoveTween(); if (tween.OnComplete != null) tween.OnComplete(ent); }); }
void removeTweenIfExist(Entity e) { if (e.hasTween) e.RemoveTween(); }