Please find 10 of your favorite photos from your photo library to use and add them to a new Project Assets folder named Photos. We are going to write a script that, given the list of images, will add them to each of the ArtworkRigs in the scene:
- To create the photos folder, navigate to Assets | Create | Folder and name it Photos
- Import 10 photos by dragging and dropping them from your File Explorer into the Photos folder that you just created (or navigate to Assets | ImportNew Asset...)
Now, we'll write a script to populate Artworks Images:
- In Hierarchy, select Artworks. Then, in Inspector, navigate to Add Component | New Script and name it PopulateArtFrames.
- Open the new script for editing.
Write the code for PopulateArtFrames.cs, as follows:
using UnityEngine;
public class PopulateArtFrames : MonoBehaviour
{
public Texture[] images;
...