Global Game Jam 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Randomizer : MonoBehaviour
  5. {
  6. public Texture2D[] bases;
  7. public Texture2D[] hats;
  8. public Texture2D[] eyes;
  9. public Texture2D[] faces;
  10. public Texture2D[] tops;
  11. public Texture2D[] bottoms;
  12. public GameObject baseObj;
  13. public GameObject hatObj;
  14. public GameObject eyeObj;
  15. public GameObject faceObj;
  16. public GameObject topObj;
  17. public GameObject bottomObj;
  18. public void RandomizeParts(int a, int b, int c, int d, int e, int f)
  19. {
  20. baseObj.GetComponent<MeshRenderer>().material.mainTexture =bases[a];
  21. hatObj.GetComponent<MeshRenderer>().material.mainTexture = hats[b];
  22. eyeObj.GetComponent<MeshRenderer>().material.mainTexture = eyes[c];
  23. faceObj.GetComponent<MeshRenderer>().material.mainTexture = faces[d];
  24. topObj.GetComponent<MeshRenderer>().material.mainTexture = tops[e];
  25. bottomObj.GetComponent<MeshRenderer>().material.mainTexture = bottoms[f];
  26. }
  27. }