public void DrawTriangleGizmos(Camera sceneViewCamera, float lodDeltaDis)
 {
     if (m_Root != null)
     {
         float dis = Vector3.Distance(sceneViewCamera.transform.position, this.bounds.center);
         int   lod = (int)(dis / lodDeltaDis);
         m_Root.DrawTriangleGizmos(Vector2.zero, Vector2.right, Vector2.up, vertex0, vertex1, vertex2, lod, m_MaxDepth);
     }
 }
        public void DrawTriangleGizmos(Vector2 weight0, Vector2 weight1, Vector2 weight2, Vector3 v0, Vector3 v1, Vector3 v2, int lod, int maxDepth)
        {
            if (m_PaintedType == PaintedType.Mix)
            {
                if (lod > maxDepth)
                {
                    return;
                }
                Vector2 halfw01 = weight0 + (weight1 - weight0) * 0.5f;
                Vector2 halfw02 = weight0 + (weight2 - weight0) * 0.5f;
                Vector2 halfw12 = weight1 + (weight2 - weight1) * 0.5f;

                if (m_CenterNode != null)
                {
                    m_CenterNode.DrawTriangleGizmos(halfw01, halfw12, halfw02, v0, v1, v2, lod + 1, maxDepth);
                }
                if (m_TopNode != null)
                {
                    m_TopNode.DrawTriangleGizmos(halfw01, weight1, halfw12, v0, v1, v2, lod + 1, maxDepth);
                }
                if (m_LeftNode != null)
                {
                    m_LeftNode.DrawTriangleGizmos(weight0, halfw01, halfw02, v0, v1, v2, lod + 1, maxDepth);
                }
                if (m_RightNode != null)
                {
                    m_RightNode.DrawTriangleGizmos(halfw02, halfw12, weight2, v0, v1, v2, lod + 1, maxDepth);
                }
            }
            else if (m_PaintedType == PaintedType.Painted)
            {
                {
                    Vector3 vertex0 = (1 - weight0.x - weight0.y) * v0 + weight0.x * v1 + weight0.y * v2;
                    Vector3 vertex1 = (1 - weight1.x - weight1.y) * v0 + weight1.x * v1 + weight1.y * v2;
                    Vector3 vertex2 = (1 - weight2.x - weight2.y) * v0 + weight2.x * v1 + weight2.y * v2;

                    Gizmos.DrawLine(vertex0, vertex1);
                    Gizmos.DrawLine(vertex0, vertex2);
                    Gizmos.DrawLine(vertex1, vertex2);
                }
            }
        }