Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input Spline Shape @ Runtime
#2
For others ... took a while, but I figure this out too.  You create a Generator in the editor and put all your shapes into the editor.  Then create an attribute:

    public InputSplineShape[] Roads;
    
That has a reference to each of the shapes you created in the ditor.

During runtime, after you've constructed the generator, you copy the appropriate shape to the generator for the shape of the road.
    
    var GENERATOR = CurvyGenerator.Create();
    var SHAPE = Roads[0].CopyTo(GENERATOR);

As for the materials, simply assign it to the volume:

    var VOLUME = GENERATOR.AddModule<BuildVolumeMesh>();
    VOLUME.SetMaterial(0,RoadMaterials[0]);


Jake, any other comments/suggestions?
Reply


Messages In This Thread
Input Spline Shape @ Runtime - by Elenesski - 09-13-2016, 04:49 AM
RE: Input Spline Shape @ Runtime - by Elenesski - 09-13-2016, 07:43 PM
RE: Input Spline Shape @ Runtime - by Jake - 09-21-2016, 07:15 PM
RE: Input Spline Shape @ Runtime - by Elenesski - 09-22-2016, 08:44 PM
RE: Input Spline Shape @ Runtime - by Elenesski - 10-02-2016, 08:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: