Esempio n. 1
0
    private void AddChannelButton(WorkshopItemType part, int number, string label)
    {
        CustomizationColorsMenuChannel component = Object.Instantiate(channelTemplate.gameObject, channelsContainer).GetComponent <CustomizationColorsMenuChannel>();

        component.gameObject.SetActive(value: true);
        channelButtons.Add(component);
        component.Bind(part, number, label);
    }
Esempio n. 2
0
 public override void OnGotFocus()
 {
     base.OnGotFocus();
     CustomizationController.instance.cameraController.FocusCharacterModel();
     AddPartButtons(WorkshopItemType.ModelFull, ScriptLocalization.CUSTOMIZATION.PartBody);
     AddPartButtons(WorkshopItemType.ModelHead, ScriptLocalization.CUSTOMIZATION.PartHead);
     AddPartButtons(WorkshopItemType.ModelUpperBody, ScriptLocalization.CUSTOMIZATION.PartUpper);
     AddPartButtons(WorkshopItemType.ModelLowerBody, ScriptLocalization.CUSTOMIZATION.PartLower);
     selectedChannel = channelButtons[0];
     EventSystem.current.SetSelectedGameObject(selectedChannel.gameObject);
     AddColorButtons();
 }
Esempio n. 3
0
    public void SelectChannel(CustomizationColorsMenuChannel channel)
    {
        if (selectedChannel != null)
        {
            if (colorApplied)
            {
                colorApplied = false;
                CustomizationController.instance.SetColor(selectedChannel.part, selectedChannel.number, colorBackup);
            }
            selectedChannel.SetActive(active: false);
        }
        selectedChannel = channel;
        selectedChannel.SetActive(active: true);
        CustomizationController.instance.cameraController.FocusPart(channel.part);
        ShowColorPalette(show: true);
        colorBackup = CustomizationController.instance.GetColor(selectedChannel.part, selectedChannel.number);
        int   num  = -1;
        float num2 = (transparent.color - colorBackup).sqrMagnitude();

        for (int i = 0; i < colorButtons.Count; i++)
        {
            float num3 = (colorButtons[i].color - colorBackup).sqrMagnitude();
            if (num3 < num2)
            {
                num2 = num3;
                num  = i;
            }
        }
        transparent.SetActive(-1 == num);
        for (int j = 0; j < colorButtons.Count; j++)
        {
            colorButtons[j].SetActive(j == num);
        }
        if (num >= 0)
        {
            EventSystem.current.SetSelectedGameObject(colorButtons[num].gameObject);
        }
        else
        {
            EventSystem.current.SetSelectedGameObject(transparent.gameObject);
        }
    }
Esempio n. 4
0
 public void HighlightChannel(CustomizationColorsMenuChannel channel)
 {
 }
Esempio n. 5
0
 public void MaskButtonToggle(CustomizationColorsMenuChannel channel)
 {
     channel.SetActive(!channel.GetActive());
     paint.SetMask(channel.part, channel.number, channel.GetActive());
 }