public void UpdateVisual() { if (playerSkills.IsSkillUnlocked(skillType)) { image.material = null; backgroundImage.material = null; backgroundImage.sprite = unlockedBackgroundImage; } else { if (playerSkills.CanUnlock(skillType)) { image.material = skillUnlockableMaterial; backgroundImage.material = skillUnlockableMaterial; } else { image.material = skillLockedMaterial; backgroundImage.material = skillUnlockableMaterial; } } }
private void UpdateVisuals() { foreach (Button button in skillButtons) { BaseSkill skill = playerSkills.GetSkillByName(button.name); if (playerSkills.IsSkillUnlocked(skill)) { button.gameObject.GetComponentInChildren <Image>().color = Color.yellow; } else { if (playerSkills.CanUnlock(skill)) { button.gameObject.GetComponentInChildren <Image>().color = Color.green; } else { button.gameObject.GetComponentInChildren <Image>().color = Color.black; } } } }
public void UpdateVisual() { if (playerSkills.IsSkillUnlocked(skillType)) { image.material = null; backgroundImage.material = null; } else { if (playerSkills.CanUnlock(skillType)) { image.material = skillUnlockableMaterial; backgroundImage.color = UtilsClass.GetColorFromString("4B677D"); transform.GetComponent <Button_UI>().enabled = true; } else { image.material = skillLockedMaterial; backgroundImage.color = new Color(.3f, .3f, .3f); transform.GetComponent <Button_UI>().enabled = false; } } }