Esempio n. 1
0
 void Start()
 {
     if (m_spline == null)
     {
         m_spline = new CatmullRom(m_controlPoints, m_resolution, m_closedLoop);
     }
 }
Esempio n. 2
0
        void OnDrawGizmos()
        {
            if (m_spline != null)
            {
                m_spline.Update(m_controlPoints);
                m_spline.Update(m_resolution, m_closedLoop);
                m_spline.DrawSpline(Color.white);

                if (m_drawNormal)
                {
                    m_spline.DrawNormals(m_normalExtrusion, Color.red);
                }

                if (m_drawTangent)
                {
                    m_spline.DrawTangents(m_tangentExtrusion, Color.cyan);
                }
            }
            else
            {
                m_spline = new CatmullRom(m_controlPoints, m_resolution, m_closedLoop);
            }
        }