Exemplo n.º 1
0
    public void SubSetBodyPart(BodyPart Body_Part, string path)
    {
        path = path + "/" + Body_Part.name;


        CustomisationStorage customisationStorage = null;

        foreach (var Custom in ThisCharacter.SerialisedBodyPartCustom)
        {
            if (path == Custom.path)
            {
                customisationStorage = Custom;
                break;
            }
        }

        if (customisationStorage != null)
        {
            bool pass = true;
            if (Body_Part.OptionalOrgans.Count > 0)
            {
                pass = false;
                BodyPartDropDownOrgans.OnPlayerBodyDeserialise(Body_Part, null,
                                                               customisationStorage.Data.Replace("@£", "\""),
                                                               livingHealthMasterBase);
            }

            if (Body_Part.OptionalReplacementOrgan.Count > 0 && pass)
            {
                pass = false;
                BodyPartDropDownReplaceOrgan.OnPlayerBodyDeserialise(Body_Part,
                                                                     customisationStorage.Data.Replace("@£", "\""),
                                                                     livingHealthMasterBase);
            }

            if (pass)
            {
                if (Body_Part.LobbyCustomisation != null)
                {
                    Body_Part.LobbyCustomisation.OnPlayerBodyDeserialise(Body_Part,
                                                                         customisationStorage.Data.Replace("@£", "\""),
                                                                         livingHealthMasterBase);
                }
                else
                {
                    Logger.Log($"[PlayerSprites] - Could not find {Body_Part.name}'s characterCustomization script. Returns -> {Body_Part.LobbyCustomisation.characterCustomization}", Category.Character);
                }
            }
        }


        foreach (var Limb in Body_Part.ContainBodyParts)
        {
            SubSetBodyPart(Limb, path);
        }
    }
Exemplo n.º 2
0
    public void SubSetBodyPart(BodyPart Body_Part, string path)
    {
        path = path + "/" + Body_Part.name;

        CustomisationStorage customisationStorage = null;

        foreach (var Custom in ThisCharacter.SerialisedBodyPartCustom)
        {
            if (path == Custom.path)
            {
                customisationStorage = Custom;
                break;
            }
        }

        if (customisationStorage != null)
        {
            var data = customisationStorage.Data.Replace("@£", "\"");
            if (Body_Part.OptionalOrgans.Count > 0)
            {
                BodyPartDropDownOrgans.OnPlayerBodyDeserialise(Body_Part, data, livingHealthMasterBase);
            }
            else if (Body_Part.OptionalReplacementOrgan.Count > 0)
            {
                BodyPartDropDownReplaceOrgan.OnPlayerBodyDeserialise(Body_Part, data);
            }
            else
            {
                if (Body_Part.LobbyCustomisation == null)
                {
                    Logger.Log($"[PlayerSprites] - Could not find {Body_Part.name}'s characterCustomization script. Returns -> {Body_Part.LobbyCustomisation.characterCustomization}", Category.Character);
                    return;
                }
                Body_Part.LobbyCustomisation.OnPlayerBodyDeserialise(Body_Part, data, livingHealthMasterBase);
            }
        }
    }