public void SubSetBodyPart(BodyPart bodyPart, string path) { path = path + "/" + bodyPart.name; if (OpenBodyCustomisation.ContainsKey(bodyPart.name)) { CustomisationStorage Customisation = null; foreach (var bodyPartCustomisation in bodyPartCustomisationStorage) { if (bodyPartCustomisation.path == path) { Customisation = bodyPartCustomisation; } } if (Customisation != null) { var TCustomisation = OpenBodyCustomisation[bodyPart.name]; TCustomisation.Deserialise(Customisation.Data.Replace("@£", "\"")); } } if (bodyPart?.Storage?.Populater?.Contents != null) { foreach (var Organ in bodyPart.Storage.Populater.Contents) { var subBodyPart = Organ.GetComponent <BodyPart>(); SubSetBodyPart(subBodyPart, path); } } }
public void SaveCustomisations(CustomisationStorage CustomisationStorage, BodyPartCustomisationBase CustomisationObject) { var Customisations = CustomisationObject.GetComponent <BodyPartCustomisationBase>(); CustomisationStorage.Data = Customisations.Serialise(); CustomisationStorage.Data = CustomisationStorage.Data.Replace("\"", "@£"); //CustomisationStorage //SavingDataStorage }
public void SubSaveBodyPart(BodyPart bodyPart, string path) { path = path + "/" + bodyPart.name; if (OpenBodyCustomisation.ContainsKey(bodyPart.name)) { var NewCustomisationStorage = new CustomisationStorage(); NewCustomisationStorage.path = path; bodyPartCustomisationStorage.Add(NewCustomisationStorage); SaveCustomisations(NewCustomisationStorage, OpenBodyCustomisation[bodyPart.name]); } if (bodyPart?.Storage?.Populater?.Contents != null) { foreach (var Organ in bodyPart.Storage.Populater.Contents) { var subBodyPart = Organ.GetComponent <BodyPart>(); SubSaveBodyPart(subBodyPart, path); } } }