It's me again. You guys have been really amazing and helpful so I was just hoping you'd help me one last time!
What I'm trying to do is to pick a random element from a list when a button is clicked. I know its not the hardest thing to do, but I'm still kinda noob and everything I seem to find its about arrays and I'm not sure an array is the thing to go after, since my list of elements could possibly grow in the future.
So far, I have this code for my listing:
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.UI;
public class FrameSelector : MonoBehaviour
{
void Start()
{
List<bool> frame = new List<bool>();
frame.Add(GameObject.Find("Frame1").GetComponent<Image>().enabled = true);
frame.Add(GameObject.Find("Frame2").GetComponent<Image>().enabled = true);
frame.Add(GameObject.Find("Frame3").GetComponent<Image>().enabled = true);
frame.Add(GameObject.Find("Frame4").GetComponent<Image>().enabled = true);
}
}
The whole point of the random picking, is to show a different image ("Frame") each time the button is pressed.
Thanks!