public RXTweenChain Add(object target, float duration, TweenConfig config) { config.onComplete(HandleTweenComplete); Tween tween = new Tween(target, duration, config, null); tweensToDo.Add(tween); return(this); }
public static TweenConfig destroyWhenComplete(this TweenConfig config) { config.onComplete((tween) => { ((tween as Tween).target as SKDestroyable).Destroy(); }); return(config); }
public static TweenConfig removeWhenComplete(this TweenConfig config) { config.onComplete(HandleRemoveWhenDoneTweenComplete); return(config); }
//forward to an action with no arguments instead (ex you can pass myNode.RemoveFromContainer) public static TweenConfig onComplete(this TweenConfig config, Action onCompleteAction) { config.onComplete((tween) => { onCompleteAction(); }); return(config); }
public static TweenConfig hideWhenComplete(this TweenConfig config) { config.onComplete((tween) => { ((tween as Tween).target as FNode).isVisible = false; }); return(config); }
public static TweenConfig removeWhenComplete(this TweenConfig config) { config.onComplete((tween) => { ((tween as Tween).target as FNode).RemoveFromContainer(); }); return(config); }
public void CallGameOver() { player.RemoveFromContainer(); TweenConfig tw = new TweenConfig(); tw.floatProp("alpha", 0); tw.onComplete(theTween => { Game.instance.GoToPage(PageType.MenuPage); }); Go.to(this, 2f, tw); }