Class PlatformerSceneGraph
A simple tool to build PlatformerGraphs directly into your Unity scene. This can be used as a starting point for your level editor or just used as is.
Use GameObject->2D Objects->PlatformerSceneGraph to create one in your scene. By default, two nodes will be created with an edge 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.PlatformerGraph.SceneGraph
Assembly: AnyPath.dll
Syntax
public class PlatformerSceneGraph : MonoBehaviour
Remarks
Make sure gizmos are on when editing a PlatformerSceneGraph.
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 PlatformerGraph
Constructors
PlatformerSceneGraph()
Declaration
public PlatformerSceneGraph()
Fields
directedEdges
All of the directed that make up the graph. This can be injected in the PlatformerGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<PlatformerGraph.Edge> directedEdges
Field Value
| Type | Description |
|---|---|
| List<PlatformerGraph.Edge> |
undirectedEdges
All of the udirected that make up the graph. This can be injected in the PlatformerGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<PlatformerGraph.Edge> undirectedEdges
Field Value
| Type | Description |
|---|---|
| List<PlatformerGraph.Edge> |
vertices
All vertices that make up the graph. This can be injected in the PlatformerGraph constructor. This data is automatically generated when clicking the Build button.
Declaration
[HideInInspector]
public List<float2> vertices
Field Value
| Type | Description |
|---|---|
| List<float2> |
Methods
CreateGraph(Allocator, bool)
Creates the native graph struct. See PlatformerGraph for details.
Declaration
public PlatformerGraph CreateGraph(Allocator allocator, bool directedEdgesRaycastable = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | Allocator to use |
| bool | directedEdgesRaycastable | Should direct edges be hit by raycast queries? See PlatformerGraph for more information. |
Returns
| Type | Description |
|---|---|
| PlatformerGraph |