UCL.Core.TextureLib.UCL_Texture2D CurveTexture() { if (m_PathPoints == null || m_PathPoints.Length == 0) { return(null); } if (m_Texture == null) { m_Texture = new TextureLib.UCL_Texture2D(256, 256); } m_Texture.SetColor(Color.black); m_Texture.DrawPath(this, GetRect(m_Dir), Color.green, m_Dir, 5 * m_PathPoints.Length); return(m_Texture); }
void ReDraw() { if (m_Texture == null) { m_Texture = new TextureLib.UCL_Texture2D(256, 256); } float rad = m_Angle * Mathf.Deg2Rad; float sin = Mathf.Sin(rad); float cos = Mathf.Cos(rad); int ex = Mathf.RoundToInt(sx + m_Len * cos); int ey = Mathf.RoundToInt(sy + m_Len * sin); //Debug.LogWarning("sin:" + sin + ",cos:" + cos + ",rad:" + rad+",sx:"+sx+",sy:"+sy); m_Texture.SetColor(Color.black); m_Texture.DrawLine(sx, sy, ex, ey, Color.yellow); //m_Texture.DrawLine(85, 10, 10, 50, Color.green); //m_Texture.DrawLine(0.1f, 0.88f, 0.9f, 0.6f, Color.red); if (m_Path) { m_Texture.DrawPath(m_Path, m_Path.GetRect(m_Dir), Color.cyan, m_Dir, m_PathSeg);//m_Range } }