Adding photos to the gallery
Please find 10 of your favorite photos from your photo library to use and add them to a new Project Assets folder named Photos
. Follow the following steps to add photos to the gallery:
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 | Import New 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 itPopulateArtFrames
.Open the new script in MonoDevelop.
Edit the code for
PopulateArtFrames.cs
, as follows (I've written the code in more lines than it was probably necessary so that I could provide explanations):using UnityEngine; using System.Collections; public class PopulateArtFrames : MonoBehaviour { public Texture[] images; void Start () { int imageIndex = 0; foreach...