public void RemoveClothing(Item_ModularClothing clothing) { if (!IsCharacterReady) { return; } clothing.ClearClothing(CharacterAvatar); Clothing.Remove(clothing); BuildCharacter(); }
bool IsOverlapping(Item_ModularClothing clothing, out Item_ModularClothing overlap) { foreach (UMATextRecipe r in clothing.Recipes) { foreach (Item_ModularClothing c in Clothing) { if (c.OverlapsOn(r.wardrobeSlot)) { overlap = c; return(true); } } } overlap = null; return(false); }
public void AddClothing(Item_ModularClothing clothing, bool buildCharacter) { if (!IsCharacterReady) { return; } if (IsOverlapping(clothing, out overlap)) { RemoveClothing(overlap); } clothing.ApplyClothing(CharacterAvatar); Clothing.Add(clothing); if (buildCharacter) { BuildCharacter(); } }
public void AddClothing(Item_ModularClothing clothing) { if (!IsCharacterReady) { return; } if (!CharacterAvatar.isActiveAndEnabled) { if (IsOverlapping(clothing, out overlap)) { RemoveClothing(overlap); } } clothing.ApplyClothing(CharacterAvatar); Clothing.Add(clothing); BuildCharacter(); }