/// <returns>May be null.</returns> private Skin ReadSkin(Stream input, SkeletonData skeletonData, String skinName, bool nonessential) { int slotCount = ReadVarint(input, true); if (slotCount == 0) { return(null); } Skin skin = new Skin(skinName); for (int i = 0; i < slotCount; i++) { int slotIndex = ReadVarint(input, true); for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { String name = ReadString(input); Attachment attachment = ReadAttachment(input, skeletonData, skin, slotIndex, name, nonessential); if (attachment != null) { skin.AddAttachment(slotIndex, name, attachment); } } } return(skin); }