示例#1
0
    public bool IsComplete(RewardBase reward)
    {
        RewardTable data = DataManager.GetInstance().GetRewardTable(reward.GetRewardType(), reward.nowLevel);

        if (data != null)
        {
            return(reward.nowValue >= data.maxValue);
        }
        Debug.Log("something is wrong");
        return(false);
    }
示例#2
0
    public string GetRewardStateText(RewardBase reward)
    {
        RewardTable data = DataManager.GetInstance().GetRewardTable(reward.GetRewardType(), reward.nowLevel);

        if (data != null)
        {
            return(reward.nowValue.ToString() + "/" + data.maxValue.ToString());
        }
        Debug.Log("something is wrong");
        return(null);
    }
示例#3
0
    private string GetConvertedRewardData()
    {
        strBuilder.Length = 0;

        for (int i = 0; i < RewardManager.GetInstance().rewardCount; i++)
        {
            RewardBase data = RewardManager.GetInstance().GetNowReward((Define.RewardType)i);
            if (data != null)
            {
                strBuilder.Append((int)data.GetRewardType());
                strBuilder.Append(dataController.delimiter);
                strBuilder.Append(data.nowLevel);
                strBuilder.Append(dataController.delimiter);
                strBuilder.Append(data.nowValue);
                strBuilder.Append(dataController.delimiter);
                strBuilder.Append(ParseBoolToInt(data.isCompleted));
                if (i < RewardManager.GetInstance().rewardCount - 1)
                {
                    strBuilder.Append(dataController.delimiter);
                }
            }
        }
        return(strBuilder.ToString());
    }