//Populate the details info passed down from attractions. public void Populate(Region.Attraction attraction) { txtAttractionTitle.text = attraction.fullText.name; txtAttractionDescription.text = attraction.fullText.text; txtAddress = attraction.address; arrayIndex = 0; imgBackground.sprite = attraction.carouselImages[arrayIndex]; attractionData = attraction; CreateImgPosPref(); }
//Give each attraction a name and bg image public void Initialize(Region.Attraction a) { attraction = a; txtTitle.text = attraction.fullText.name; imgBackground.sprite = attraction.attractionImg; }
//Create attraction prefabs when region is clicked public void Add(Region.Attraction a) { UIAttraction newAttraction = Instantiate(prefAttraction, attractionContainer); newAttraction.Initialize(a); }