Exemplo n.º 1
0
        public static List <PathData> GetPathDatas(GameResData gameResData, int limitCount)
        {
            List <PathData> pathDataList = new List <PathData>();
            DropMessageData data         = DropMessageData.GetDropMsgDataByResData(gameResData, true);

            if (data == null)
            {
                return(null);
            }
            else
            {
                Dictionary <GoodsJumpType, List <int> > jumpDic = data.JumpDic;
                int index = 0;
                foreach (var value in jumpDic)
                {
                    if (value.Key == GoodsJumpType.Jump_Dungeon)
                    {
                        List <int> idList = value.Value;
                        int        id;
                        for (int i = 0; i < idList.Count; i++)
                        {
                            id = idList[i];
                            int         remaindCount = limitCount - index;
                            DungeonInfo dInfo        = DungeonProxy.instance.GetDungeonInfo(id);
                            if (dInfo == null)
                            {
                                Debugger.LogError("dungeon can not find in jump path, id:" + id);
                            }
                            else if (!dInfo.isLock || i < remaindCount)
                            {
                                pathDataList.Add(new PathData(value.Key, id));
                                index++;
                                if (index == limitCount)
                                {
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        List <int> idList = value.Value;
                        int        id;
                        for (int i = 0; i < idList.Count; i++)
                        {
                            id = idList[i];
                            pathDataList.Add(new PathData(value.Key, id));
                            index++;
                            if (index == limitCount)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            return(pathDataList);
        }
Exemplo n.º 2
0
        public static DropMessageData GetDropMsgDataByResData(GameResData resData, bool includeDefault = false)
        {
            DropMessageData data = GetDropMsgDataByResData((int)resData.type, resData.id, resData.count, resData.star);

            if (data == null && includeDefault)
            {
                data = GetDropMsgDataByResData((int)resData.type, resData.id, 0, 0);
            }
            return(data);
        }