Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var clothingFiles = Directory.GetFiles(ClothesDirectory);
- NAPI.Util.ConsoleOutput($"Found {clothingFiles.Length} Clothing Files");
- foreach (var clothingItem in clothingFiles)
- {
- string content = File.ReadAllText($"{clothingItem}");
- var result = JsonConvert.DeserializeObject<Dictionary<object, object>>(content);
- foreach (var pair in result)
- {
- clothesData.Add((clothesData)pair.Key, (ClothesInfo)pair.Value);
- }
- }
- return clothesData;
- }
- How my JSON file looks
- {new clothesData((int)ClothesType.Mask, 1, 0), new ClothesInfo("Pig Mask", "Pig Mask",50) },
- {new clothesData((int)ClothesType.Mask, 1, 1), new ClothesInfo("Brown Pig Mask", "Brown Pig Mask",50) },
- {new clothesData((int)ClothesType.Mask, 1, 2), new ClothesInfo("Bloody Pig Mask", "Bloody Pig Mask",50) },
- {new clothesData((int)ClothesType.Mask, 1, 3), new ClothesInfo("Black Pig Mask", "Black Pig Mask",50) },
- {new clothesData((int)ClothesType.Mask, 2, 0), new ClothesInfo("Skull Mask","Skull Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 2, 1), new ClothesInfo(" Gray Skull Mask","Gray Skull Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 2, 2), new ClothesInfo("Black Skull Mask","Black Skull Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 2, 3), new ClothesInfo("Bone Skull Mask","Bone Skull Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 3, 0), new ClothesInfo("Pogo Mask", "Pogo Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 4, 0), new ClothesInfo("White Hockey Mask","White Hockey Mask", 50) },
- {new clothesData((int)ClothesType.Mask, 4, 1), new ClothesInfo("Red Hockey Mask","Red Hockey Mask", 50) },
Add Comment
Please, Sign In to add comment