using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(SpriteRenderer))] public class BackgroundShuffle : MonoBehaviour { public List backgrounds; private SpriteRenderer spriteRenderer; void Awake() { spriteRenderer = GetComponent(); } void Start() { spriteRenderer.sprite = backgrounds.PickRandom(); } }