Пример #1
0
 public SerializedCurvySpline(CurvySpline spline, CurvySerializationSpace space = CurvySerializationSpace.WorldSpline)
 {
     if (spline)
     {
         Name            = spline.name;
         P               = (space == CurvySerializationSpace.Self) ? spline.transform.localPosition : spline.transform.position;
         R               = (space == CurvySerializationSpace.Self) ? spline.transform.localRotation.eulerAngles : spline.transform.rotation.eulerAngles;
         Interpolation   = spline.Interpolation;
         Keep2D          = spline.RestrictTo2D;
         Closed          = spline.Closed;
         AutoEndTangents = spline.AutoEndTangents;
         Orientation     = spline.Orientation;
         BzAutoDist      = spline.AutoHandleDistance;
         CacheDensity    = spline.CacheDensity;
         Pooling         = spline.UsePooling;
         Threading       = spline.UseThreading;
         CheckTForm      = spline.CheckTransform;
         UpdateIn        = spline.UpdateIn;
         ControlPoints   = new SerializedCurvySplineSegment[spline.ControlPointCount];
         for (int i = 0; i < spline.ControlPointCount; i++)
         {
             ControlPoints[i] = new SerializedCurvySplineSegment(spline.ControlPoints[i]);
         }
     }
 }
Пример #2
0
 public SerializedCurvySplineSegmentCollection(List <CurvySplineSegment> cps, CurvySerializationSpace space = CurvySerializationSpace.WorldSpline)
 {
     ControlPoints = new SerializedCurvySplineSegment[cps.Count];
     for (int i = 0; i < cps.Count; i++)
     {
         ControlPoints[i] = new SerializedCurvySplineSegment(cps[i], space);
     }
 }