private void SliderChanged(float saturation, float value) { if (listen) { picker.AssignColor(ColorValues.Saturation, saturation); picker.AssignColor(ColorValues.Value, value); } listen = true; }
private void SliderChanged(float newValue) { if (listen) { hsvPicker.AssignColor(type, slider.normalizedValue); } listen = true; }
// Start is called before the first frame update void Start() { ColorPicker.onValueChanged.AddListener(color => { _tintColor = color; }); ColorPicker.AssignColor(_tintColor); }
public void ToggleColorPickerWindow() { if (!colorPickerWindow.activeInHierarchy) { colorPicker.AssignColor(selectedYarnPanel.outputColor); } else { selectedYarnPanel.UpdateColor(); } colorPickerWindow.SetActive(!colorPickerWindow.activeInHierarchy); }
private void SliderChanged(float newValue) { if (listen) { newValue = slider.normalizedValue; //if (type == ColorValues.Hue) // newValue = 1 - newValue; hsvpicker.AssignColor(type, newValue); } listen = true; }
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); } }
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); }
private void SliderChanged(float newValue) { hsvpicker.AssignColor(type, newValue); }