Figure 11-13. The Rock’s various associated assets also being exported
6. Give it a name, SingleRock, and save it somewhere outside of the project folder.
You’ve just made your first Unity package, SingleRock.unitypackage. Unity packages retain relationships,
preserve materials and shaders, scripts, and various other non-project-based elements. To test it, you can change your
original rock prefab.
1. Select the Rock Prefab.
2. Drag it into the Hierarchy view.
3. In Scene view, change its orientation and one of its scale dimensions.
4. Move it up above the ground a couple of meters in the Scene view. Make sure it is not
above the Rock Zone.
5. Create a new Prefab and name it and the scene rock Rock1.
6. Drag the new configuration of the rock onto the new prefab.
7. Click Play and watch it drop and settle.
8. Delete the original Rock Prefab from the Project view.
Now let’s import the package you just saved out.
9. From the Assets menu, Import Package, select Custom Package.
10. Locate your SingleRock package and import it.
The Import dialog shows only the name of the prefab; if you had imported it to an empty scene, all of the meshes,
textures, scripts, etc., would have appeared as well.
If you had altered the original Rock Prefab and left it in the scene, importing would have caused it to revert to
the imported version.
11. Drag the Rock Prefab into the Hierarchy view, to assure yourself it is the same as when youexported it.
412