示例#1
0
        /// <summary>
        /// Check the cureent pointer position and texture position.
        /// </summary>
        /// <returns>Return Vector2 the coordinate of texture point.</returns>
        public virtual Vector2 CurrentPointerPosition()
        {
            if (currentObject != null)
            {
                return(PaintTexture.GetTextureCordinate(imagePosition, pointerPosition, screenRatio, imageTexture, currentObject.transform.eulerAngles.z));
            }

            return(Vector2.zero);
        }
示例#2
0
        /// <summary>
        /// ErasePaint is use for erasing the texture in given position.
        /// Need to pass start and end point of pointer position.
        /// </summary>
        /// <param name="point1">Vector2 Start position of pointer.</param>
        /// <param name="point2">Vector2 End position of pointer.</param>
        public void ErasePaint(Vector2 point1, Vector2 point2)
        {
            if (point2 == Vector2.zero)
            {
                point2 = point1;
            }

            PaintTexture.Erase(point1, point2, (radius / objectScale), (opacity / objectScale), imageTexture);
            imageTexture.Apply();
        }
示例#3
0
        /// <summary>
        /// ApplyPaint method is called to paint color on texture.
        /// Need to pass start and end point of pointer position.
        /// And color to apint in texture
        /// </summary>
        /// <param name="point1">Vector2 Start position of pointer.</param>
        /// <param name="point2">Vector2 End position of pointer.</param>
        /// <param name="color">Color to paint in texture.</param>
        public void ApplyPaint(Vector2 point1, Vector2 point2, Color color)
        {
            if (point2 == Vector2.zero)
            {
                point2 = point1;
            }

            PaintTexture.Paint(point1, point2, (radius / objectScale), color, (opacity / objectScale), imageTexture, false);
            imageTexture.Apply();
        }