Tanoda
unity-ui-extensions/Runtime/Scripts/Controls/ColorPicker/ColorImage.cs
Go to the documentation of this file.
1
3
4
6{
7 [RequireComponent(typeof(Image))]
8public class ColorImage : MonoBehaviour
9{
11
12 private Image image;
13
14 private void Awake()
15 {
16 image = GetComponent<Image>();
17 picker.onValueChanged.AddListener(ColorChanged);
18 }
19
20 private void OnDestroy()
21 {
22 picker.onValueChanged.RemoveListener(ColorChanged);
23 }
24
25 private void ColorChanged(Color newColor)
26 {
27 image.color = newColor;
28 }
29}
30}
System.Drawing.Image Image
Definition: TestScript.cs:37
UnityEngine.Color Color
Definition: TestScript.cs:32