Пример #1
0
    /// <summary>
    /// Sets up the sprites for all body parts using the given RaceVariantTextureData
    /// </summary>
    public void SetupAllBodySprites(RaceVariantTextureData Variant)
    {
        Color?newSkinColor = null;

        if (ColorUtility.TryParseHtmlString(ThisCharacter.SkinTone, out var tempSkinColor))
        {
            newSkinColor = tempSkinColor;
        }

        SetupBodySprite(Variant.Torso, "body_torso", newSkinColor);
        SetupBodySprite(Variant.LegRight, "body_rightleg", newSkinColor);
        SetupBodySprite(Variant.LegLeft, "body_leftleg", newSkinColor);
        SetupBodySprite(Variant.ArmRight, "body_rightarm", newSkinColor);
        SetupBodySprite(Variant.ArmLeft, "body_leftarm", newSkinColor);
        SetupBodySprite(Variant.Head, "body_head", newSkinColor);
        SetupBodySprite(Variant.HandRight, "body_right_hand", newSkinColor);
        SetupBodySprite(Variant.HandLeft, "body_left_hand", newSkinColor);

        Color?newEyeColor = null;

        if (ColorUtility.TryParseHtmlString(ThisCharacter.EyeColor, out var tempEyeColor))
        {
            newEyeColor = tempEyeColor;
        }

        SetupBodySprite(Variant.Eyes, "eyes", newEyeColor);
    }
Пример #2
0
    public void SexSetupBodySprites(RaceVariantTextureData Variant)
    {
        ColorUtility.TryParseHtmlString(ThisCharacter.skinTone, out var newColor);

        if (Variant.Torso.Texture != null)
        {
            clothes["body_torso"].spriteHandler.Infos = new SpriteData();
            clothes["body_torso"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Torso));
            clothes["body_torso"].spriteHandler.SetColor(newColor);
            clothes["body_torso"].spriteHandler.PushTexture();
        }


        if (Variant.LegRight.Texture != null)
        {
            clothes["body_rightleg"].spriteHandler.Infos = new SpriteData();
            clothes["body_rightleg"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.LegRight));
            clothes["body_rightleg"].spriteHandler.SetColor(newColor);
            clothes["body_rightleg"].spriteHandler.PushTexture();
        }


        if (Variant.LegLeft.Texture != null)
        {
            clothes["body_leftleg"].spriteHandler.Infos = new SpriteData();
            clothes["body_leftleg"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.LegLeft));
            clothes["body_leftleg"].spriteHandler.SetColor(newColor);
            clothes["body_leftleg"].spriteHandler.PushTexture();
        }

        if (Variant.ArmRight.Texture != null)
        {
            clothes["body_rightarm"].spriteHandler.Infos = new SpriteData();
            clothes["body_rightarm"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.ArmRight));
            clothes["body_rightarm"].spriteHandler.SetColor(newColor);
            clothes["body_rightarm"].spriteHandler.PushTexture();
        }


        if (Variant.ArmLeft.Texture != null)
        {
            clothes["body_leftarm"].spriteHandler.Infos = new SpriteData();
            clothes["body_leftarm"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.ArmLeft));
            clothes["body_leftarm"].spriteHandler.SetColor(newColor);
            clothes["body_leftarm"].spriteHandler.PushTexture();
        }


        if (Variant.Head.Texture != null)
        {
            clothes["body_head"].spriteHandler.Infos = new SpriteData();
            clothes["body_head"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Head));
            clothes["body_head"].spriteHandler.SetColor(newColor);
            clothes["body_head"].spriteHandler.PushTexture();
        }


        if (Variant.HandRight.Texture != null)
        {
            clothes["body_right_hand"].spriteHandler.Infos = new SpriteData();
            clothes["body_right_hand"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.HandRight));
            clothes["body_right_hand"].spriteHandler.SetColor(newColor);
            clothes["body_right_hand"].spriteHandler.PushTexture();
        }


        if (Variant.HandLeft.Texture != null)
        {
            clothes["body_left_hand"].spriteHandler.Infos = new SpriteData();
            clothes["body_left_hand"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.HandLeft));
            clothes["body_left_hand"].spriteHandler.SetColor(newColor);
            clothes["body_left_hand"].spriteHandler.PushTexture();
        }

        ColorUtility.TryParseHtmlString(ThisCharacter.eyeColor, out newColor);
        if (Variant.Eyes.Texture != null)
        {
            clothes["eyes"].spriteHandler.Infos = new SpriteData();
            clothes["eyes"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Eyes));
            clothes["eyes"].spriteHandler.SetColor(newColor);
            clothes["eyes"].spriteHandler.PushTexture();
        }
    }