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