prime31
6/20/2012 - 6:40 PM

Quick and easy endless color cycle using GoKit

Quick and easy endless color cycle using GoKit

var chain = new TweenChain();
chain.setIterations( -1, LoopType.PingPong );

// colors is an array of Color objects that is settable in the inspector
// in this case, we set the cameras background color but this could be light colors, material colors, etc
for( var i = 0; i < colors.Length; i++ )
	chain.append( new Tween( Camera.mainCamera, 6f, new TweenConfig().colorProp( "backgroundColor", colors[i] ) ) );
		
chain.play();