Example #1
0
    public void SetMask(WorkshopItemType part, int number, bool on)
    {
        int num = 1 << number - 1;

        mask[part] = ((mask[part] & ~num) | (on ? num : 0));
        RagdollModel model = customization.GetModel(part);

        if (model != null)
        {
            model.SetMask(mask[part]);
        }
    }
    public void SetPart(WorkshopItemType part, RagdollPresetPartMetadata data)
    {
        if (data != null)
        {
            data.suppressCustomTexture = true;
        }
        activeCustomization.preset.SetPart(part, data);
        activeCustomization.ApplyPreset(activeCustomization.preset);
        RagdollModel model = activeCustomization.GetModel(part);

        if (model != null)
        {
            data.color1 = HexConverter.ColorToHex(model.color1);
            data.color2 = HexConverter.ColorToHex(model.color2);
            data.color3 = HexConverter.ColorToHex(model.color3);
        }
        activeCustomization.RebindColors(bake: false);
    }