void Awake() { _pointerPixelEvents = GetComponent <UIImagePointerClickToPixel>(); _pointerPixelEvents.OnPointerDown.AddListener((x, y, color) => { SelectColor(color); }); _pointerPixelEvents.OnPointerDrag.AddListener((x, y, color) => { SelectColor(color); }); _pointerPixelEvents.OnPointerDown.Invoke(2, 2, Palette.CoordToColor(2, 2)); }
void Awake() { _rawImage = GetComponent <RawImage>(); myRectTransform = GetComponent <RectTransform>(); _pointerPixelEvents = GetComponent <UIImagePointerClickToPixel>(); }