GameController

If this is a new scene, we need to add GameController, as follows:

  1. In Hierarchy, click Create Empty object and name it GameController.
  2. Add the GameController script as a component.
  3. Then drag the prefab DefaultPicture from your Prefabs folder into the Default Picture Object slot.

We will spawn new pictures at the target image origin, so modify the CreateNewPicture function as follows:

File: GameController.cs
public Transform imageTarget; public void CreateNewPicture() { GameObject newPicture = Instantiate(defaultPictureObject, imageTarget); }
  1. Then in Unity, selectGameController and drag the ImageTarget into its Image Target slot.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.83.150