Learning NGUI for Unity
上QQ阅读APP看书,第一时间看更新

Importing NGUI

First of all, create a new Unity project with the name LearnNGUI.

Now that we have our new project, there are two different ways to import NGUI. Follow the Importing from the Asset Store section if you buy the plugin directly from the Asset Store.

If you already have the package on your disk, move on to the Importing from disk section.

Note

At the time I am writing these lines, the latest version of NGUI is V3.7.7 with Unity 4.6.1. Depending on the version you work with, slight changes might occur.

Importing from the Asset Store

After buying the product from the Asset Store, download and import it by performing the following steps:

  1. Navigate to Window | AssetStore.
  2. Select your Downloads library. Once your downloads library is open, find the plugin within the list of packages. The result is shown in the following screenshot:
    Importing from the Asset Store
  3. Now, click on the Download button (1) next to NGUI: Next-Gen UI.
  4. Click on the Import button (2), and wait for a pop-up window to appear.

Ok. Once the Importing package pop-up window appears, skip the following section (reserved for users who already have the NGUI package on disk) and move on to the Package Importing section of the book.

Importing from a disk

If you already have NGUI's Unity package on your disk, follow these steps:

  1. Navigate to Assets | Import Package | Custom Package...
  2. Browse to your NGUI's .unitypackage file location.
  3. Double-click on the .unitypackage file to import it.

When the Importing package window is displayed, continue to the next section.

Package importing

You have opted to import NGUI's package for Unity, and the Importing package window should be displayed. Follow these steps to finalize the importation:

  1. Make sure everything is checked, and click on the Import button (3), as shown in the following screenshot:
    Package importing
  2. Click anywhere on the toolbar (4) to update it. The NGUI menu appears as shown in the following screenshot:
    Package importing

    Tip

    If the NGUI menu doesn't appear even after clicking on the toolbar, restart Unity, and it will appear.

We have now successfully imported the plugin into our project. Let's create our first UI!