Hello,
(What I am doing)
What I am doing is I have a button prefab in a scrollable panel. The button and its text is loaded through WWW, as well as instantiating more prefabs for each button needed.
When a user clicks on one, it should use an IEnumerator to load the story associated with that title and then open a new panel with the story loaded. So what I was thinking was attaching a C# script to the panel holding the button prefabs and when a button is clicked, it will load the story associated with that button ID via WWW.
(The Problem)
My question is how the buttons know which story to load? My idea was to attach and use the prefab’s C# script to hold the story ID and when it’s clicked: the main script can ask that C# script what ID it was. How do I do that though, and also change the script’s ID for every new button i instantiate?