diff --git a/Assets/Demo/scripts/TweenChainGUI.cs b/Assets/Demo/scripts/TweenChainGUI.cs index ca08e9a..aa7e22d 100644 --- a/Assets/Demo/scripts/TweenChainGUI.cs +++ b/Assets/Demo/scripts/TweenChainGUI.cs @@ -25,8 +25,9 @@ void Start() chain.setOnCompleteHandler( c => Debug.Log( "chain complete" ) ); // create a Tween for each cube and it to the chain - foreach( var cube in cubes ) + for( int i = 0; i < cubes.Length; ++i ) { + var cube = cubes[i]; var tween = new GoTween( cube, 0.5f, config ); chain.append( tween ); } diff --git a/Assets/Demo/scripts/TweenFlowGUI.cs b/Assets/Demo/scripts/TweenFlowGUI.cs index 64f4a34..8a5c70a 100644 --- a/Assets/Demo/scripts/TweenFlowGUI.cs +++ b/Assets/Demo/scripts/TweenFlowGUI.cs @@ -30,18 +30,15 @@ void Start() // create a Tween for each cube and add it to the flow var startTime = 0f; - foreach( var cube in cubes ) + for( int i = 0; i < cubes.Length; ++i ) { - var tween = new GoTween( cube, 0.5f, config ); + var cube = cubes[i]; + var tween = new GoTween(cube, 0.5f, config); flow.insert( startTime, tween ); - // increment our startTime so that the next tween starts when this one is halfway done startTime += 1.0f; - - var tweenTwo = new GoTween( cube, 0.5f, config ); flow.insert( startTime, tweenTwo ); - startTime += 0.25f; } diff --git a/Assets/Editor/GoDummyPathEditor.cs b/Assets/Editor/GoDummyPathEditor.cs index c2b4bc6..4043512 100644 --- a/Assets/Editor/GoDummyPathEditor.cs +++ b/Assets/Editor/GoDummyPathEditor.cs @@ -1,7 +1,6 @@ using UnityEngine; using UnityEditor; using System.Collections; -using System.Linq; using System.Collections.Generic; using System.IO; diff --git a/Assets/Plugins/GoKit/Go.cs b/Assets/Plugins/GoKit/Go.cs index 3f2e853..1557c23 100644 --- a/Assets/Plugins/GoKit/Go.cs +++ b/Assets/Plugins/GoKit/Go.cs @@ -371,12 +371,13 @@ public static void removeTweenWithTag( string tag ) List tweenList = tweensWithTag( tag ); if( tweenList != null ) { - foreach( var tween in tweenList ) + for( int i = 0; i < tweenList.Count; ++i ) { + var tween = tweenList[i]; removeTween( tween ); } } - } + } /// /// returns a list of all Tweens, TweenChains and TweenFlows with the given tag @@ -384,8 +385,9 @@ public static void removeTweenWithTag( string tag ) public static List tweensWithTag( string tag ) { List list = null; - foreach( var tween in _tweens ) + for( int i = 0; i < _tweens.Count; ++i ) { + var tween = _tweens[i]; if( tween.tag == tag ) { if( list == null )