base class for TweenChains and TweenFlows
Inheritance: AbstractGoTween
    public List <GoTween> tweensWithTarget(object target)
    {
        List <GoTween> list = new List <GoTween>();

        for (int i = 0; i < _tweenFlows.Count; i++)
        {
            TweenFlowItem tweenFlowItem = _tweenFlows[i];
            if (tweenFlowItem.tween == null)
            {
                continue;
            }
            GoTween goTween = tweenFlowItem.tween as GoTween;
            if (goTween != null && goTween.target == target)
            {
                list.Add(goTween);
            }
            if (goTween != null)
            {
                continue;
            }
            AbstractGoTweenCollection abstractGoTweenCollection = tweenFlowItem.tween as AbstractGoTweenCollection;
            if (abstractGoTweenCollection != null)
            {
                List <GoTween> list2 = abstractGoTweenCollection.tweensWithTarget(target);
                if (list2.Count > 0)
                {
                    list.AddRange(list2);
                }
            }
        }
        return(list);
    }
Exemple #2
0
    public static List <GoTween> tweensWithTarget(object target, bool traverseCollections = false)
    {
        List <GoTween> list = new List <GoTween>();

        for (int i = 0; i < _tweens.Count; i++)
        {
            AbstractGoTween abstractGoTween = _tweens[i];
            GoTween         goTween         = abstractGoTween as GoTween;
            if (goTween != null && goTween.target == target)
            {
                list.Add(goTween);
            }
            if (!traverseCollections || goTween != null)
            {
                continue;
            }
            AbstractGoTweenCollection abstractGoTweenCollection = abstractGoTween as AbstractGoTweenCollection;
            if (abstractGoTweenCollection != null)
            {
                List <GoTween> list2 = abstractGoTweenCollection.tweensWithTarget(target);
                if (list2.Count > 0)
                {
                    list.AddRange(list2);
                }
            }
        }
        return(list);
    }
 static public int play(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         self.play();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int prepareAllTweenProperties(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         self.prepareAllTweenProperties();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int clearDidInitFlag(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         self.clearDidInitFlag();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int isValid(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         var ret = self.isValid();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #7
0
    /// <summary>
    /// returns a list of all Tweens with the given target. TweenChains and TweenFlows can optionally
    /// be traversed and matching Tweens returned as well.
    /// </summary>
    public static List <GoTween> tweensWithTarget(object target, bool traverseCollections = false)
    {
        List <GoTween> list = new List <GoTween>();

        for (int i = 0; _tweens.Count > i; i++)
        {
            GoTween tween = _tweens[i] as GoTween;

            if (tween != null && tween.target == target)
            {
                list.Add(tween);
            }

            // optionally check TweenChains and TweenFlows. if tween is null we have a collection
            if (traverseCollections && tween == null)
            {
                AbstractGoTweenCollection tweenCollection = ( AbstractGoTweenCollection )_tweens[i];
                if (tweenCollection != null)
                {
                    List <GoTween> tweensInCollection = tweenCollection.tweensWithTarget(target);

                    if (tweensInCollection.Count > 0)
                    {
                        list.AddRange(tweensInCollection);
                    }
                }
            }
        }

        /*foreach ( var item in _tweens )
         * {
         *  // we always check Tweens so handle them first
         *  var tween = item as GoTween;
         *  if ( tween != null && tween.target == target )
         *      list.Add( tween );
         *
         *  // optionally check TweenChains and TweenFlows. if tween is null we have a collection
         *  if ( traverseCollections && tween == null )
         *  {
         *      var tweenCollection = item as AbstractGoTweenCollection;
         *      if ( tweenCollection != null )
         *      {
         *          var tweensInCollection = tweenCollection.tweensWithTarget( target );
         *          if ( tweensInCollection.Count > 0 )
         *              list.AddRange( tweensInCollection );
         *      }
         *  }
         * }*/

        return(list);
    }
 static public int constructor(IntPtr l)
 {
     try {
         AbstractGoTweenCollection o;
         GoTweenCollectionConfig   a1;
         checkType(l, 2, out a1);
         o = new AbstractGoTweenCollection(a1);
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int containsTweenProperty(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         AbstractTweenProperty     a1;
         checkType(l, 2, out a1);
         var ret = self.containsTweenProperty(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int tweensWithTarget(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         System.Object             a1;
         checkType(l, 2, out a1);
         var ret = self.tweensWithTarget(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int update(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         System.Single             a1;
         checkType(l, 2, out a1);
         var ret = self.update(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int goTo(IntPtr l)
 {
     try {
         AbstractGoTweenCollection self = (AbstractGoTweenCollection)checkSelf(l);
         System.Single             a1;
         checkType(l, 2, out a1);
         System.Boolean a2;
         checkType(l, 3, out a2);
         self.goTo(a1, a2);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    /// <summary>
    /// returns a list of all Tweens with the given target in the collection
    /// technically, this should be marked as internal
    /// </summary>
    public List <GoTween> tweensWithTarget(object target)
    {
        List <GoTween> list = new List <GoTween>();

        for (int i = 0; _tweenFlows.Count > i; i++)
        {
            TweenFlowItem item = _tweenFlows[i];

            // skip TweenFlowItems with no target
            if (item == null)
            {
                continue;
            }

            GoTween tween = item.tween as GoTween;

            if (tween != null && tween.target == target)
            {
                list.Add(tween);
            }
            else if (tween == null)
            {
                AbstractGoTweenCollection tweenCollection = ( AbstractGoTweenCollection )item.tween;

                if (tweenCollection != null)
                {
                    List <GoTween> tweensInCollection = tweenCollection.tweensWithTarget(target);

                    if (tweensInCollection.Count > 0)
                    {
                        list.AddRange(tweensInCollection);
                    }
                }
            }
        }

        /*foreach ( var flowItem in _tweenFlows )
         * {
         *  // skip TweenFlowItems with no target
         *  if ( flowItem.tween == null )
         *      continue;
         *
         *  // check Tweens first
         *  var tween = flowItem.tween as GoTween;
         *  if ( tween != null && tween.target == target )
         *      list.Add( tween );
         *
         *  // check for TweenCollections
         *  if ( tween == null )
         *  {
         *      var tweenCollection = flowItem.tween as AbstractGoTweenCollection;
         *      if ( tweenCollection != null )
         *      {
         *          var tweensInCollection = tweenCollection.tweensWithTarget( target );
         *          if ( tweensInCollection.Count > 0 )
         *              list.AddRange( tweensInCollection );
         *      }
         *  }
         * }*/

        return(list);
    }