Class LineSceneGraph
A simple tool to build LineGraphs directly into your Unity scene. This can be used as a starting point for your level editor or just used as is.
Use GameObject->3D Objects->LineGraph to create one in your scene. By default, two nodes will be created with an edge/line connecting them. Adding nodes is done by dragging the cirle that appears when the node is selected. Dragging it onto another node will create an edge connecting the two nodes. Edges are also gameObjects and their properties can be adjusted by selecting them.
Namespace: AnyPath.Graphs.Line.SceneGraph
Assembly: AnyPath.dll
Syntax
public class LineSceneGraph : MonoBehaviour
Remarks
Make sure gizmos are on when editing a LineSceneGraph.
Don't forget to click the Build button in the inspector when you're done editing the graph. This will convert the data into a suitable format which can be used to create the native LineGraph
Similar to AnyPath.Graphs.PlatformerGraph.SceneGraph, but in 3D.
Constructors
LineSceneGraph()
Declaration
public LineSceneGraph()
Fields
directedEdges
All of the directed that make up the graph. This can be injected in the LineGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<LineGraph.Edge> directedEdges
Field Value
| Type | Description |
|---|---|
| List<LineGraph.Edge> |
undirectedEdges
All of the udirected that make up the graph. This can be injected in the LineGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<LineGraph.Edge> undirectedEdges
Field Value
| Type | Description |
|---|---|
| List<LineGraph.Edge> |
vertices
All vertices that make up the graph. This can be injected in the LineGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<float3> vertices
Field Value
| Type | Description |
|---|---|
| List<float3> |
Methods
CreateGraph(Allocator, bool)
Creates the native graph struct. See LineGraph for details.
Declaration
public LineGraph CreateGraph(Allocator allocator, bool directedEdgesQueryable = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | Allocator to use |
| bool | directedEdgesQueryable | Should direct edges be hit by closest location queries? See LineGraph for more information. |
Returns
| Type | Description |
|---|---|
| LineGraph |