public void PopulatePanel(SO_NewUnlock newUnlock) { this.newUnlock = newUnlock; //researchThumbnail.sprite = newUnlock.thumbnail; researchName.text = newUnlock.unlockName; researchCost.text = newUnlock.researchCost.ToString(); researchTime.text = newUnlock.researchTime.ToString(); if (!newUnlock.isUnlocked) { panelImage.color = Color.gray; isUnlocked = false; } }
//Check to see if the object has yet been unlocked or notS private bool checkIfUnlocked(SO_NewUnlock newUnlock) { bool[] isUnlocked = new bool[newUnlock.prerequisits.Length]; for (int i = 0; i < newUnlock.prerequisits.Length; i++) { if (newUnlock.prerequisits[i].isUnlocked) { Debug.Log(newUnlock.unlockName + " " + newUnlock.prerequisits[i].unlockName); isUnlocked[i] = true; } else { continue; } } return(isUnlocked.All(x => x)); }