Hi,
Can anyone please help me out?
I have created some buttons from a prefab button and I am using the Instantiate method.
The buttons load different levels in the game using OnClick.AddListener()
The script works fine when I test it in unity, it loads the scenes as expected. But when I test it on my iphone it doesn't work. When I click on the buttons nothing happens it doesn't even appear like it is detecting a click on the button.
Appreciate anyone's help as I am stuck and not sure what the problem is. I have attached the code below:
public void FillList()
{
foreach(var level in levelList)
{
//instantiating prefab
GameObject newButton = Instantiate (levelButton) as GameObject;
LevelButton button = newButton.GetComponent();
button.LevelText.text = level.LevelText;
if (PlayerPrefs.GetInt ("Level " + button.LevelText.text) == 1)
{
level.Unlocked = 1;
level.IsInteractable = true;
}
button.unlocked = level.Unlocked;
button.GetComponent
↧