Ejemplo n.º 1
0
    public void SetData(FMLoginBonusItem item)
    {
        string isCurrency = item.Reward.Type == FMRewardType.Currency ? "x " : "";

        rewardLab.text          = isCurrency + item.Reward.GetValue();
        rewardSprite.spriteName = GetRewardSprite(item.Reward);
        State = item.State;

        //sometimes start is called after this
        if (bgSprite == null)
        {
            bgSprite = GetComponent <UISprite>();
        }

        switch (State)
        {
        case FMLoginBonusState.Today:
            bgSprite.color = todayColor;
            break;

        case FMLoginBonusState.Claimed:
            bgSprite.color = claimedColor;
            break;
        }
    }
 public FMLoginBonusItem(int index, FMRewardItem item, FMLoginBonusState state)
 {
     Index  = index;
     Reward = item;
     State  = state;
 }