// Render a FeatherAndCount (struct) to an IconAndCount (prefab) public static void RenderFeatherAndCount(FeatherAndCount feathAndCount, GameObject obj) { obj.SetActive(GameData.singleton.feathersUnlocked[(int)feathAndCount.type]); obj.GetComponentInChildren <Image>().sprite = null; // clear the sprite in case of weird sprite change bug obj.GetComponentInChildren <Image>().sprite = SpriteManager.GetSprite(feathAndCount.type.GetImage()); obj.GetComponentInChildren <Image>().color = feathAndCount.type.GetColor(); obj.GetComponentInChildren <Text>().text = feathAndCount.count.ToString(); }
public static void RenderFeatherAndCountIgnoringUnlocks(FeatherAndCount feathAndCount, GameObject obj) { RenderFeatherAndCount(feathAndCount, obj); obj.SetActive(true); }