09-03-2021, 07:40 PM
(09-03-2021, 07:06 PM)Wyldhunt Wrote: An example should be perfect. Thanks, @_Aka_.
I looked at a few examples, but couldn't find the one that did it with code.
I copied the content of said method here:
Code:
// Create the Curvy Generator
CurvyGenerator gen = CurvyGenerator.Create();
gen.AutoRefresh = false;
// Create Modules
InputSplinePath path = gen.AddModule<InputSplinePath>();
InputSplineShape shape = gen.AddModule<InputSplineShape>();
BuildShapeExtrusion extrude = gen.AddModule<BuildShapeExtrusion>();
BuildVolumeMesh vol = gen.AddModule<BuildVolumeMesh>();
CreateMesh msh = gen.AddModule<CreateMesh>();
// Create Links between modules
path.OutputByName["Path"].LinkTo(extrude.InputByName["Path"]);
shape.OutputByName["Shape"].LinkTo(extrude.InputByName["Cross"]);
extrude.OutputByName["Volume"].LinkTo(vol.InputByName["Volume"]);
vol.OutputByName["VMesh"].LinkTo(msh.InputByName["VMesh"]);
// Set module properties
path.Spline = TrackSpline;
path.UseCache = true;
CSRectangle rectShape = shape.SetManagedShape<CSRectangle>();
rectShape.Width = 20;
rectShape.Height = 2;
extrude.Optimize = false;
#pragma warning disable 618
extrude.CrossHardEdges = true;
#pragma warning restore 618
vol.Split = false;
vol.SetMaterial(0, RoadMaterial);
vol.MaterialSetttings[0].SwapUV = true;
msh.Collider = CGColliderEnum.None;
return gen;
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.