public void AddCrystal(CrystalScript.CrystalType type) { if (_collectedCrystals.IndexOf(type) >= 0) { return; } _collectedCrystals.Add(type); UiController.SetCrystal(type); if (_collectedCrystals.Count >= 3) { _levelStat.HasCrystals = true; } }
public void SetCrystal(CrystalScript.CrystalType type) { transform.Find("Crystals").Find(type.ToString()).GetComponent <Image>().sprite = Crystals[type]; }