Beispiel #1
0
    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);
    }
Beispiel #2
0
 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);
 }
Beispiel #4
0
 //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);
 }
Beispiel #5
0
 public static TweenConfig hideWhenComplete(this TweenConfig config)
 {
     config.onComplete((tween) => { ((tween as Tween).target as FNode).isVisible = false; });
     return(config);
 }
Beispiel #6
0
 public static TweenConfig removeWhenComplete(this TweenConfig config)
 {
     config.onComplete((tween) => { ((tween as Tween).target as FNode).RemoveFromContainer(); });
     return(config);
 }
Beispiel #7
0
 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);
 }