/** * Metodo che imposta una determinata immagine come quella selezionata in * modo da poterne modificare il valore del colore. */ private void OnColorSelected() { activeColor.GetComponent<Transform>().localScale = new Vector3( activeColor.GetComponent<Transform>().localScale.x / SELECTED_COLOR_SIZE_INCR, activeColor.GetComponent<Transform>().localScale.y / SELECTED_COLOR_SIZE_INCR ); foreach (GameObject color in Colori) { if (color.GetComponent<InteractionButton>().isPressed) { activeColor = color; } } activeColor.GetComponent<Transform>().localScale = new Vector3( activeColor.GetComponent<Transform>().localScale.x * SELECTED_COLOR_SIZE_INCR, activeColor.GetComponent<Transform>().localScale.y * SELECTED_COLOR_SIZE_INCR ); SliderRed.GetComponent<InteractionSlider>().HorizontalSliderValue = activeColor.GetComponent<Renderer>().material.color.r; SliderGreen.GetComponent<InteractionSlider>().HorizontalSliderValue = activeColor.GetComponent<Renderer>().material.color.g; SliderBlue.GetComponent<InteractionSlider>().HorizontalSliderValue = activeColor.GetComponent<Renderer>().material.color.b; SliderAlpha.GetComponent<InteractionSlider>().HorizontalSliderValue = activeColor.GetComponent<Renderer>().material.color.a; Color32 c = activeColor.GetComponent<Renderer>().material.color; RValue.text = c.r.ToString(); GValue.text = c.g.ToString(); BValue.text = c.b.ToString(); AValue.text = c.a.ToString(); }
void Reset() { if (slider == null) { slider = GetComponent <InteractionSlider>(); } if (sliderGraphic == null) { sliderGraphic = slider.GetComponent <LeapGraphic>(); if (sliderGraphic == null) { sliderGraphic = slider.GetComponentInChildren <LeapGraphic>(); } } if (panelGraphic == null && slider.transform.parent != null) { panelGraphic = slider.transform.parent.GetComponentInParent <LeapGraphic>(); } panelGraphicColor = new Color(0.86F, 0.86F, 0.86F); panelDepressedColor = new Color(0.86F, 0.86F, 0.86F); panelDisabledColor = new Color(0.60F, 0.60F, 0.60F); panelTint = Color.white; sliderGraphicColor = new Color(1.00F, 1.00F, 1.00F); sliderDepressedColor = new Color(0.60F, 0.60F, 0.60F); sliderDisabledColor = new Color(0.80F, 0.80F, 0.80F); sliderTint = Color.white; }