using System.Collections; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using Unity.VisualScripting; using UnityEngine; //* General Comments or Finished Tasks //TODO Tasks left to be done for game //! Bugs or Issues //? Questions or Suggestions public class Colours : MonoBehaviour { public GameObject Box; public GameObject[] containers; public List materials = new List(); private GameObject currentBox; private int num; //* Start is called before the first frame update void Start() { //* Instantiate 8 containers with random colours at the start of the game for (int i = 0; i < containers.Length; i++) { currentBox = Instantiate(Box, new Vector3(Random.Range(10, -10), 15, Random.Range(-10, 10)), Quaternion.identity); num = Random.Range(0, materials.Count); currentBox.GetComponent().material = materials[num]; containers[i].GetComponent().material = materials[num]; materials.RemoveAt(num); } } }