private void AddIconFor(MoodletEffect effect) { GameObject newMoodlet = Instantiate(MoodletPrefab); newMoodlet.GetComponent <MoodletView>().SetItem(effect); newMoodlet.GetComponent <MoodletView>().SetHint(hint); newMoodlet.transform.SetParent(transform); }
public static void AddMoodlet(MoodletEffect effect) { if (effects.IndexOf(effect) < 0) { effects.Add(effect); if (effects.Count > MAX_EFFECTS) { effects.RemoveAt(0); } EventManager.TriggerEvent(MoodletEffect.EFFECT_ADDED); } }
private string GetTextFor(MoodletEffect item) { return(item.text); }
public void SetItem(MoodletEffect item) { this.item = item; UIUtils.LoadSourceToImage(GetComponent <Image>(), "Moodlets/" + item.icon); }