Example #1
0
    private void AddIconFor(MoodletEffect effect)
    {
        GameObject newMoodlet = Instantiate(MoodletPrefab);

        newMoodlet.GetComponent <MoodletView>().SetItem(effect);
        newMoodlet.GetComponent <MoodletView>().SetHint(hint);
        newMoodlet.transform.SetParent(transform);
    }
Example #2
0
 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);
     }
 }
Example #3
0
 private string GetTextFor(MoodletEffect item)
 {
     return(item.text);
 }
Example #4
0
    public void SetItem(MoodletEffect item)
    {
        this.item = item;

        UIUtils.LoadSourceToImage(GetComponent <Image>(), "Moodlets/" + item.icon);
    }