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 //TODO As the timer goes down, the containers have a chance to switch renders/colours //! Somtimes boxes get thrown further than other times. Boxes also sometimes get thrown into random directions. 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); } } }