public override void Apply (Path p, ModifierData source) {
//This should never trigger unless some other modifier has messed stuff up
if (p.vectorPath == null) {
Debug.LogWarning ("Can't process NULL path (has another modifier logged an error?)");
return;
}
List<Vector3> path = null;
switch (smoothType) {
case SmoothType.Simple:
path = SmoothSimple (p.vectorPath); break;
case SmoothType.Bezier:
path = SmoothBezier (p.vectorPath); break;
case SmoothType.OffsetSimple:
path = SmoothOffsetSimple (p.vectorPath); break;
case SmoothType.CurvedNonuniform:
path = CurvedNonuniform (p.vectorPath); break;
}
if (path != p.vectorPath) {
ListPool<Vector3>.Release (p.vectorPath);
p.vectorPath = path;
}
//.vectorPath.Clear ();
//p.vectorPath.AddRange (path);
}