public void LoadItemOnPart(Items.ClothItem item, Items.BodyPart bodyPart) { CharacterPart part = GetPart(bodyPart); if (item == null) { if (bodyPart.isDisabledWhenEmpty) { if (part != null) { part.meshRenderer.enabled = false; } } else { if (part != null) { part.meshRenderer.sharedMesh = part.defaultMesh; part.meshRenderer.material = part.defaultMaterial; part.meshRenderer.enabled = true; } } } else { part.meshRenderer.sharedMesh = item.mesh; part.meshRenderer.material = item.material; part.meshRenderer.enabled = true; } }
CharacterPart GetPart(Items.BodyPart bodyPart) { CharacterPart result = null; partsDict.TryGetValue(bodyPart, out result); return(result); }