示例#1
0
 public List <TaskRewardEntity> GetTaskRewardList()
 {
     if (m_TaskRewardEntityList == null)
     {
         m_TaskRewardEntityList = new List <TaskRewardEntity>();
         string[] rewardArr = Rewards.Split('|');
         for (int i = 0; i < rewardArr.Length; i++)
         {
             TaskRewardEntity rewardEntity = TaskRewardDBModel.Instance.Get(rewardArr[i].ToInt());
             if (rewardEntity == null)
             {
                 Debug.LogError("错误:奖励实体找不到");
                 continue;
             }
             m_TaskRewardEntityList.Add(rewardEntity);
         }
     }
     return(m_TaskRewardEntityList);
 }
        //获取奖励回调
        private void OnGetRewardCallBack(int rewardId)
        {
            TaskRewardEntity entity = TaskRewardDBModel.Instance.Get(rewardId);

            if (entity == null)
            {
                Debug.LogError("错误:奖励实体找不到");
                return;
            }
            switch (entity.RewardType)
            {
            case 0:
                Debug.Log("加经验:" + entity.Count);
                break;

            case 1:
                Debug.Log("加金币:" + entity.Count);
                SimulatedDatabase.Instance.AddCoin(entity.Count);
                break;
            }
        }
示例#3
0
 public TaskReward(int taskRewardId)
 {
     m_TaskRewardEntity = TaskRewardDBModel.Instance.Get(taskRewardId);
 }