コード例 #1
0
    private static ThreePart FindThreePart(int id, List <ThreePart> lst)
    {
        for (int i = 0; i < lst.Count; ++i)
        {
            ThreePart tp = lst[i];
            if (tp.id == id)
            {
                return(tp);
            }
        }
        ThreePart newTp = new ThreePart();

        newTp.id = id;
        lst.Add(newTp);
        return(newTp);
    }
コード例 #2
0
    public static void MakeEquip(string name, int[] fashionIDs, List <EquipPart> equipList, TempEquipSuit tmpFashionData, int suitID)
    {
        FashionList fashionList = XTableMgr.GetTable <FashionList>();

        if (fashionIDs != null)
        {
            tmpFashionData.hash = 0;
            tmpFashionData.data.Clear();
            bool threePart = false;
            for (int i = 0; i < fashionIDs.Length; ++i)
            {
                int fashionID           = fashionIDs[i];
                FashionList.RowData row = fashionList.GetByUID(fashionID);
                if (row != null)
                {
                    List <ThreePart> tpLst = new List <ThreePart>();
                    if (row.EquipPos == 7 || row.EquipPos == 8 || row.EquipPos == 9)
                    {
                        ThreePart tp = FindThreePart(suitID, tpLst);
                        if (row.EquipPos == 9)
                        {
                            tp.part[2] = row.ModelPrefabArcher;
                        }
                        threePart = true;
                    }
                    else
                    {
                        if (row.ReplaceID != null && row.ReplaceID.Length > 1)
                        {
                            FashionList.RowData replace = fashionList.GetByUID(row.ReplaceID[1]);
                            if (replace != null)
                            {
                                if (replace.EquipPos == row.EquipPos)
                                {
                                    row = replace;
                                }
                            }
                        }
                        string path = row.ModelPrefabArcher;
                        if (!string.IsNullOrEmpty(path))
                        {
                            Hash(ref tmpFashionData.hash, path);
                            TempEquipData data = new TempEquipData();
                            data.row  = row;
                            data.path = path;
                            tmpFashionData.data.Add(data);
                        }
                    }
                }
            }
            if (threePart)
            {
                return;
            }

            bool          findSame = false;
            TempEquipSuit suit     = tmpFashionData;
            if (suit.hash == 0)
            {
                return;
            }
            for (int j = 0; j < equipList.Count; ++j)
            {
                EquipPart part = equipList[j];
                if (part != null && part.hash == suit.hash)
                {
                    part.suitName.Add(name);
                    findSame = true;
                    break;
                }
            }
            if (!findSame)
            {
                EquipPart part = new EquipPart();
                part.hash = suit.hash;
                part.suitName.Add(name);
                for (int j = 0; j < suit.data.Count; ++j)
                {
                    TempEquipData data    = suit.data[j];
                    int           partPos = ConvertPart(data.row.EquipPos);
                    if (partPos < part.partPath.Length)
                    {
                        part.partPath[partPos] = data.path;
                    }
                    else if (partPos == part.partPath.Length)
                    {
                        part.mainWeapon = data.path;
                    }
                }
                equipList.Add(part);
            }
        }
    }