private void SetupUI() { //Clear any Tries if (code != null) { code.Clear(); } else { code = new List <int>(); } if (ui != null) { ui.Clear(); } else { ui = new List <NumUI>(); } ClearScreen(Display.transform); ClearScreen(CodeDisplay.transform); TriesDisplay.text = $"Tries Left: {Tries}"; Display.constraintCount = curTry; //Build Columns for (int i = 1; i <= curTry; i++) { NumUI numUI = Instantiate(NumPrefab, Display.transform).GetComponent <NumUI>(); numUI.SetCode(i, -1); } }
//Enter a number into decoder for current attempt public void EnterNumber(int num) { if (curTry > 0) { NumUI numUI = Instantiate(NumPrefab, Display.transform).GetComponent <NumUI>(); numUI.SetCode(num, 0); ui.Add(numUI); curTry--; } }
void Start() { //healthUI = GetComponentInChildren<HealthUI>(); shieldsUI = GetComponentInChildren <ShieldsUI>(); speedUI = GetComponentInChildren <SpeedUI>(); numUI = GetComponentInChildren <NumUI>(); //healthBar = healthUI.healthBar; shieldsBar = shieldsUI.shieldsBar; speedBar = speedUI.speedBar; healthNum = numUI.healthNum; }