예제 #1
0
 private void SliderChanged(float saturation, float value)
 {
     if (listen)
     {
         picker.AssignColor(ColorValues.Saturation, saturation);
         picker.AssignColor(ColorValues.Value, value);
     }
     listen = true;
 }
예제 #2
0
 private void SliderChanged(float newValue)
 {
     if (listen)
     {
         hsvPicker.AssignColor(type, slider.normalizedValue);
     }
     listen = true;
 }
예제 #3
0
    // Start is called before the first frame update
    void Start()
    {
        ColorPicker.onValueChanged.AddListener(color =>
        {
            _tintColor = color;
        });

        ColorPicker.AssignColor(_tintColor);
    }
예제 #4
0
 public void ToggleColorPickerWindow()
 {
     if (!colorPickerWindow.activeInHierarchy)
     {
         colorPicker.AssignColor(selectedYarnPanel.outputColor);
     }
     else
     {
         selectedYarnPanel.UpdateColor();
     }
     colorPickerWindow.SetActive(!colorPickerWindow.activeInHierarchy);
 }
예제 #5
0
    private void SliderChanged(float newValue)
    {
        if (listen)
        {
            newValue = slider.normalizedValue;
            //if (type == ColorValues.Hue)
            //    newValue = 1 - newValue;

            hsvpicker.AssignColor(type, newValue);
        }
        listen = true;
    }
예제 #6
0
        private void TextChanged(string value)
        {
            if (float.TryParse(value, out float v))
            {
                v = (float)Math.Round(v, 3);

                if (clampToValues)
                {
                    v = Mathf.Clamp(v, minValue, maxValue);
                }

                picker.AssignColor(type, v);
            }
        }
예제 #7
0
 private void UpdateTeamComposition()
 {
     for (int i = 0; i < TankSettingsDropdowns.Count; i++)
     {
         TankSettingsDropdowns[i].ClearOptions();
         TankSettingsDropdowns[i].AddOptions(new List <string> {
             "Empty"
         });
         TankSettingsDropdowns[i].AddOptions(_tankSettings
                                             .Select(setting => setting.TankName + " of " + setting.PlayerName).ToList());
         if (i < _currentTeam.TankSettings.Count)
         {
             TankSettingsDropdowns[i].SetValueWithoutNotify(_tankSettings.IndexOf(_currentTeam.TankSettings[i]) + 1);
         }
         else
         {
             TankSettingsDropdowns[i].SetValueWithoutNotify(0);
         }
         TankSettingsDropdowns[i].onValueChanged.AddListener(delegate {
             _currentTeam.TankSettings.Clear();
             foreach (TMP_Dropdown tmpDropdown in TankSettingsDropdowns)
             {
                 if (tmpDropdown.value > 0)
                 {
                     _currentTeam.TankSettings.Add(_tankSettings[tmpDropdown.value - 1]);
                 }
             }
             _teamToggles[_currentTeam].GetComponentInChildren <TextMeshProUGUI>().text = _currentTeam.TeamName;
             TeamSettings.gameObject.SetActive(true);
         });
     }
     ColorPicker.AssignColor(_currentTeam.Color);
     ColorPicker.onValueChanged.AddListener(delegate(Color color) {
         _currentTeam.Color = color;
         _teamToggles[_currentTeam].GetComponentInChildren <TextMeshProUGUI>().color = color;
     });
 }
 public void SetColorPickerColor(Color a)
 {
     picker.AssignColor(color: a);
 }
예제 #9
0
 private void SliderChanged(float newValue)
 {
     hsvpicker.AssignColor(type, newValue);
 }