Tanoda
HSVPicker/UI/ColorImage.cs
Go to the documentation of this file.
1
using
UnityEngine
;
2
using
UnityEngine
.
UI
;
3
4
[RequireComponent(typeof(
Image
))]
5
public
class
ColorImage
: MonoBehaviour
6
{
7
public
ColorPicker
picker
;
8
9
private
Image
image;
10
11
private
void
Awake()
12
{
13
image = GetComponent<Image>();
14
picker
.
onValueChanged
.AddListener(ColorChanged);
15
}
16
17
private
void
OnDestroy()
18
{
19
picker
.
onValueChanged
.RemoveListener(ColorChanged);
20
}
21
22
private
void
ColorChanged(
Color
newColor)
23
{
24
image.color = newColor;
25
}
26
}
Image
System.Drawing.Image Image
Definition:
TestScript.cs:37
Color
UnityEngine.Color Color
Definition:
TestScript.cs:32
ColorImage
Definition:
HSVPicker/UI/ColorImage.cs:6
ColorImage.picker
ColorPicker picker
Definition:
HSVPicker/UI/ColorImage.cs:7
ColorPicker
Definition:
ColorPicker.cs:6
ColorPicker.onValueChanged
ColorChangedEvent onValueChanged
Definition:
ColorPicker.cs:19
UnityEngine.UI
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
HSVPicker
UI
ColorImage.cs
Generated by
1.9.3