void LightTweenCompleted(ITween <Vector2> tween) { // get a random point on screen and a random delay for the tweens var target = new Vector2(Random.Range(50, SceneRenderTargetSize.X - 100), Random.Range(50, SceneRenderTargetSize.Y - 100)); var delay = Random.Range(0f, 1f); var transform = tween.GetTargetObject() as Transform; tween.PrepareForReuse(transform.Position, target, 2f) .SetCompletionHandler(LightTweenCompleted) .SetDelay(delay) .Start(); // every so often add a scale tween if (Random.Chance(60)) { transform.TweenLocalScaleTo(transform.LocalScale.X * 2f, 1f) .SetLoops(LoopType.PingPong) .SetEaseType(EaseType.CubicIn) .SetDelay(delay) .Start(); } // every so often change our color if (Random.Chance(80)) { var sprite = transform.Entity.GetComponent <SpriteRenderer>(); PropertyTweens.ColorPropertyTo(sprite, "Color", Random.NextColor(), 2f) .SetDelay(delay) .Start(); } }