The tweens we have used until now were components we added to GameObjects in the scene. It is also possible to easily add tweens to GameObjects through code.
You can see all available tweens by simply typing Tween
inside any method in your favorite IDE. You will see a list of Tween
classes thanks to auto-completion, as shown in the following screenshot:
The strong point of these classes is that they work in one line and don't have to be executed at each frame; you just have to call their Begin()
method!
Here, we will apply tweens on widgets, but keep in mind that it works in the exact same way with other GameObjects since NGUI widgets are GameObjects.