Exemplo n.º 1
0
        void PlacePointer(PointerEventData eventData)
        {
            var pos = new Vector2(eventData.position.x - picker.hsvSlider.rectTransform.position.x, picker.hsvSlider.rectTransform.position.y - eventData.position.y);

            pos.y /= picker.hsvSlider.rectTransform.rect.height * picker.hsvSlider.canvas.transform.lossyScale.y;

            //Debug.Log(eventData.position.ToString() + " " + picker.hsvSlider.rectTransform.position + " " + picker.hsvSlider.rectTransform.rect.height);
            pos.y = Mathf.Clamp(pos.y, 0, 1f);

            picker.MovePointer(pos.y);
        }
 static public int MovePointer(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HSVPicker self = (UnityEngine.UI.Extensions.HSVPicker)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         System.Boolean a2;
         checkType(l, 3, out a2);
         var ret = self.MovePointer(a1, a2);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }