public void addCrystal(Crystal.CrystalType crystalType) { if (crystalPanel != null) { if (crystalCount < crystalsOnLevel) { crystalPanel.GetComponentsInChildren <SpriteRenderer> () [crystalCount++].sprite = crystalSpriteArr [(int)crystalType]; collectedCrystals.Add(crystalType); } } }
public void addCrystal(Crystal.CrystalType type) { switch (type) { case Crystal.CrystalType.Blue: crystalBlue.sprite = Blue; break; case Crystal.CrystalType.Red: crystalRed.sprite = Red; break; case Crystal.CrystalType.Green: crystalGreen.sprite = Green; break; default: break; } }