public tweensWithTarget ( object target ) : List |
||
target | object | |
return | List |
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); }
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); }
/// <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 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)); } }
/// <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); }