using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace LastZero.Utility
{
public class Painting : MonoBehaviour
{
public Color mColor = Color.black;//画笔颜色
//[HideInInspector]
public Texture brushTexture;//画笔
[HideInInspector]
public float brushScale = 0.1f;//画笔大小
[HideInInspector]
public bool isEraser = false;//是否使用橡皮擦
private RenderTexture texRender;//接收图的RenderTexture
public Material mat;//材质球
private RawImage rImage;//RawImage,自身
private RectTransform rTransform;//RectTransform
private Vector3 startPosition = Vector3.zero;
private Vector3 endPosition = Vector3.zero;
private Vector2 posOffset;
//
//
[SerializeField]
private Image _defaultColorImage;
#region 毛笔接口
public class tagFPOINT
{
public int x;
public int y;
public double time;
public double time2;
public double time3;
public tagFPOINT()
{
this.x = 0; this.y = 0; this.time = 0; this.time2 = 0; this.time3 = 0;
}
public tagFPOINT(int x, int y, double time, double time2, double time3)
{
this.x = x; this.y = y; this.time = time; this.time2 = time2; this.time3 = time3;
}
}
private List<tagFPOINT> n_list = new List<tagFPOINT>();
private System.Random r_guid;
//
private int pen_width = 10;
private int imgwidth = 40;//90;
private int imgheight = 5;//90;
private int i_mincount = 8;// 24;
private tagFPOINT oldpoint = null;
private double old_width;
private double i_endr = 0.0;
private double i_cwidth = 0.0;
private tagFPOINT nextpoint = null;
private double i_end = 0.0;
private int i_minwidth = 5;
private Color pen_color = Color.black;
private int i_time = 0;
private bool b_down = false;
#endregion
private void Start()
{
init_MyPen();
SetPainting();
posOffset.Set((Screen.width - rTransform.sizeDelta.x * transform.root.localScale.x) / 2 + transform.position.x - transform.root.position.x, (Screen.height - rTransform.sizeDelta.y * transform.root.localScale.y) / 2 + transform.position.y - transform.root.position.y);
}
void Update()
{/*
if (Input.GetMouseButton(0))
{
DragUpdate();
}
if (Input.GetMouseButtonUp(0))
{
DragEnd();
}*/
}
qq:77211022 微信:13762930029
标签:int,double,transform,private,unity,签名,time,public From: https://www.cnblogs.com/huiyunsoft/p/17122296.html