Creating a Simple Tween

Now that we have iTween included in our project, we can use it inside of our code; to do that, perform the following steps:

  1. From the Unity Editor, open the MainMenu level by going to the Project window and double-clicking on the MainMenu scene.
  2. Now, move to the Scripts folder and open the MainMenuBehaviour by double-clicking on it.
  1. Firstly, we will add the following new function, which we will use:
/// <summary> /// Will move an object from the left side of the screen /// to the center /// </summary> /// <param name="obj">The UI element we would like to /// move</param> public void SlideMenuIn(GameObject obj) {    obj.SetActive(true);   var rt = obj.GetComponent<RectTransform>();  // Set the object's position offscreen ...

Get Unity 2017 Mobile Game Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.