Esempio n. 1
0
 private bool RewardIsValid(TaskInfo.TaskStarReward rReward)
 {
     return(rReward.coin > 0 ||
            rReward.diamond > 0 ||
            rReward.expr > 0 ||
            rReward.fatigue > 0 ||
            rReward.props.Length > 0);
 }
Esempio n. 2
0
    public void SetAward(TaskInfo.TaskStarReward Info, List <GameObject> list, bool pos = true)
    {
        if (Info == null)
        {
            return;
        }

        SetDetailInfo(Info.expr, Info.activePoint, Info.fatigue, Info.coin, Info.diamond, list, pos, null, Info.props);
    }
Esempio n. 3
0
    public void BindData(TaskInfo.TaskStarReward rItems)
    {
        AssertInit();
        var list = rItems.ToItemPairList();

        list.RemoveAll(item =>
        {
            var prop = ConfigManager.Get <PropItemInfo>(item.itemId);
            return(!(prop && prop.proto != null && (prop.proto.Contains(CreatureVocationType.All) || prop.proto.Contains((CreatureVocationType)Module_Player.instance.proto))));
        });
        m_dataSource = new DataSource <ItemPair>(list, m_scrollView, OnSetData);
    }
Esempio n. 4
0
        private void RefreshReward(TaskInfo.TaskStarReward reward, bool activeStar)
        {
            m_rewardItemObj.SafeSetActive(!activeStar);
            m_alreadyGet.SafeSetActive(activeStar);
            greenBg.SafeSetActive(activeStar);

            if (reward == null)
            {
                return;
            }

            if (m_rewardItemObj && m_rewardItemObj.activeInHierarchy)
            {
                int propId = reward.diamond > 0 ? 2 : (reward.props != null && reward.props.Length > 0) ? reward.props[0].propId : reward.coin > 0 ? 1 : 0;
                int num    = reward.diamond > 0 ? reward.diamond : (reward.props != null && reward.props.Length > 0) ? reward.props[0].num : reward.coin > 0 ? reward.coin : 0;

                var rewardInfo = ConfigManager.Get <PropItemInfo>(propId);
                if (rewardInfo)
                {
                    Util.SetItemInfo(m_rewardItemObj, rewardInfo, 0, num, false);
                }
            }
        }