Now that we have iTween included in our project, we can use it inside of our code; to do that, perform the following steps:
- From the Unity Editor, open the MainMenu level by going to the Project window and double-clicking on the MainMenu scene.
- Now, move to the Scripts folder and open the MainMenuBehaviour by double-clicking on it.
- 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 ...