RandomSprite.cs 265 Bytes
Newer Older
Luke Smith's avatar
Luke Smith committed
1 2 3 4 5 6 7 8 9 10 11 12
using UnityEngine;
using System.Collections;

public class RandomSprite : MonoBehaviour {

    public Sprite[] tiles;

	// Use this for initialization
	void Start () {
        GetComponent<SpriteRenderer>().sprite = tiles[Random.Range(0, tiles.Length)];
    }
}