using System.Collections; using System.Collections.Generic; using UnityEngine; public class Randomizer : MonoBehaviour { public Texture2D[] bases; public Texture2D[] hats; public Texture2D[] eyes; public Texture2D[] faces; public Texture2D[] tops; public Texture2D[] bottoms; public GameObject baseObj; public GameObject hatObj; public GameObject eyeObj; public GameObject faceObj; public GameObject topObj; public GameObject bottomObj; public void RandomizeParts(int a, int b, int c, int d, int e, int f) { baseObj.GetComponent().material.mainTexture =bases[a]; hatObj.GetComponent().material.mainTexture = hats[b]; eyeObj.GetComponent().material.mainTexture = eyes[c]; faceObj.GetComponent().material.mainTexture = faces[d]; topObj.GetComponent().material.mainTexture = tops[e]; bottomObj.GetComponent().material.mainTexture = bottoms[f]; } }