Creating a controller and a scene controller script

The last object we need to create is a scene controller with an attached SceneController script. A Controller GameObject is often used as a repository for scripts that need to run but are not attached to any object. These scripts generally listen for specific actions (like those from a player) and manage multiple instances (like those generated by AI GameObjects) within a scene:

  1. Create an empty GameObject in the Hierarchy window and rename it Controller.
  2. Add a blank script to the Controller called SceneController. This will be our last script and like the ImageSelector we will modify it in the next chapter.
  1. Move the SceneController scripts into the Script folder.
  2. Save the scene and Unity project.
  3. Use File | Save Scene to create WIP_4.

We now have a completed Gallery GameObject. From this, we will build more galleries to hold additional titles, images, and thumbnails.