A* Pathfinding Project  4.1.17
The A* Pathfinding Project for Unity 3D
GridGraphEditor Class Reference

Public Types

enum  GridPivot {
  Center, TopLeft, TopRight, BottomLeft,
  BottomRight
}
 

Public Member Functions

override void OnInspectorGUI (NavGraph target)
 Override to implement graph inspectors. More...
 
override void OnSceneGUI (NavGraph target)
 Override to implement scene GUI drawing for the graph. More...
 
- Public Member Functions inherited from GraphEditor
bool AutoScan ()
 Called by editor scripts to rescan the graphs e.g when the user moved a graph. More...
 
void OnBaseInspectorGUI (NavGraph target)
 Draws common graph settings. More...
 
virtual void OnEnable ()
 
bool ToggleGroup (string label, bool value)
 Draws a toggle with a bold label to the right. More...
 

Static Public Member Functions

static GridPivot PivotPointSelector (GridPivot pivot)
 
static Vector3 RoundVector3 (Vector3 v)
 Rounds a vector's components to multiples of 0.5 (i.e 0.5, 1.0, 1.5, etc.) if very close to them. More...
 
- Static Public Member Functions inherited from GraphEditor
static bool FixLabel (string label, string buttonLabel="Fix", int buttonWidth=40)
 Draws a small help box with a 'Fix' button to the right. More...
 
static Object ObjectField (string label, Object obj, System.Type objType, bool allowSceneObjects)
 
static Object ObjectField (GUIContent label, Object obj, System.Type objType, bool allowSceneObjects)
 
static void Separator ()
 Draws a thin separator line. More...
 
static bool ToggleGroup (GUIContent label, bool value)
 Draws a toggle with a bold label to the right. More...
 

Public Attributes

bool isMouseDown
 
bool locked = true
 
GridPivot pivot
 
bool showExtra
 
- Public Attributes inherited from GraphEditor
AstarPathEditor editor
 
FadeArea fadeArea
 Stores if the graph is visible or not in the inspector. More...
 
FadeArea infoFadeArea
 Stores if the graph info box is visible or not in the inspector. More...
 
- Public Attributes inherited from GraphEditorBase
NavGraph target
 NavGraph this editor is exposing. More...
 

Protected Member Functions

virtual void Draw2DMode (GridGraph graph)
 
virtual void DrawCollisionEditor (GraphCollision collision)
 Draws the inspector for a GraphCollision class . More...
 
virtual void DrawCutCorners (GridGraph graph)
 
void DrawErosion (GridGraph graph)
 
virtual void DrawJPS (GridGraph graph)
 
virtual void DrawMaxClimb (GridGraph graph)
 
void DrawMaxSlope (GridGraph graph)
 
virtual void DrawMiddleSection (GridGraph graph)
 
virtual void DrawNeighbours (GridGraph graph)
 
virtual void DrawTextureData (GridGraph.TextureData data, GridGraph graph)
 Draws settings for using a texture as source for a grid. More...
 
virtual void DrawUse2DPhysics (GraphCollision collision)
 

Static Protected Attributes

static readonly string [] ChannelUseNames = { "None", "Penalty", "Height", "Walkability and Penalty" }
 

Private Member Functions

InspectorGridMode DetermineGridType (GridGraph graph)
 
void DrawFirstSection (GridGraph graph)
 
void DrawInspectorMode (GridGraph graph)
 
void DrawIsometricField (GridGraph graph)
 
void DrawLastSection (GridGraph graph)
 
void DrawPenaltyModifications (GridGraph graph)
 
void DrawPositionField (GridGraph graph)
 
void DrawRotationField (GridGraph graph)
 
void DrawWidthDepthFields (GridGraph graph, out int newWidth, out int newDepth)
 
bool IsAdvanced (GridGraph graph)
 
bool IsHexagonal (GridGraph graph)
 
bool IsIsometric (GridGraph graph)
 

Static Private Member Functions

static bool Is2D (GridGraph graph)
 
static Vector3 NormalizedPivotPoint (GridGraph graph, GridPivot pivot)
 
static void SaveReferenceTexture (GridGraph graph)
 

Private Attributes

Vector2 savedDimensions
 
float savedNodeSize
 
GraphTransform savedTransform
 

Static Private Attributes

static GUIStyle gridPivotSelectBackground
 Cached gui style. More...
 
static GUIStyle gridPivotSelectButton
 Cached gui style. More...
 
static readonly Vector3 [] handlePoints = new [] { new Vector3(0.0f, 0, 0.5f), new Vector3(1.0f, 0, 0.5f), new Vector3(0.5f, 0, 0.0f), new Vector3(0.5f, 0, 1.0f) }
 
static GUIStyle lockStyle
 Cached gui style. More...
 
static readonly float standardDimetric = Mathf.Acos(1/2f)*Mathf.Rad2Deg
 
static readonly float standardIsometric = 90-Mathf.Atan(1/Mathf.Sqrt(2))*Mathf.Rad2Deg
 

Member Enumeration Documentation

◆ GridPivot

enum GridPivot
strong
Enumerator
Center 
TopLeft 
TopRight 
BottomLeft 
BottomRight 

Member Function Documentation

◆ DetermineGridType()

InspectorGridMode DetermineGridType ( GridGraph  graph)
private

◆ Draw2DMode()

virtual void Draw2DMode ( GridGraph  graph)
protectedvirtual

◆ DrawCollisionEditor()

virtual void DrawCollisionEditor ( GraphCollision  collision)
protectedvirtual

Draws the inspector for a GraphCollision class .

Reimplemented in LayerGridGraphEditor.

◆ DrawCutCorners()

virtual void DrawCutCorners ( GridGraph  graph)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawErosion()

void DrawErosion ( GridGraph  graph)
protected

◆ DrawFirstSection()

void DrawFirstSection ( GridGraph  graph)
private

◆ DrawInspectorMode()

void DrawInspectorMode ( GridGraph  graph)
private

◆ DrawIsometricField()

void DrawIsometricField ( GridGraph  graph)
private

◆ DrawJPS()

virtual void DrawJPS ( GridGraph  graph)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawLastSection()

void DrawLastSection ( GridGraph  graph)
private

◆ DrawMaxClimb()

virtual void DrawMaxClimb ( GridGraph  graph)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawMaxSlope()

void DrawMaxSlope ( GridGraph  graph)
protected

◆ DrawMiddleSection()

virtual void DrawMiddleSection ( GridGraph  graph)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawNeighbours()

virtual void DrawNeighbours ( GridGraph  graph)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawPenaltyModifications()

void DrawPenaltyModifications ( GridGraph  graph)
private

◆ DrawPositionField()

void DrawPositionField ( GridGraph  graph)
private

◆ DrawRotationField()

void DrawRotationField ( GridGraph  graph)
private

◆ DrawTextureData()

virtual void DrawTextureData ( GridGraph.TextureData  data,
GridGraph  graph 
)
protectedvirtual

Draws settings for using a texture as source for a grid.

A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here

Reimplemented in LayerGridGraphEditor.

◆ DrawUse2DPhysics()

virtual void DrawUse2DPhysics ( GraphCollision  collision)
protectedvirtual

Reimplemented in LayerGridGraphEditor.

◆ DrawWidthDepthFields()

void DrawWidthDepthFields ( GridGraph  graph,
out int  newWidth,
out int  newDepth 
)
private

◆ Is2D()

static bool Is2D ( GridGraph  graph)
staticprivate

◆ IsAdvanced()

bool IsAdvanced ( GridGraph  graph)
private

◆ IsHexagonal()

bool IsHexagonal ( GridGraph  graph)
private

◆ IsIsometric()

bool IsIsometric ( GridGraph  graph)
private

◆ NormalizedPivotPoint()

static Vector3 NormalizedPivotPoint ( GridGraph  graph,
GridPivot  pivot 
)
staticprivate

◆ OnInspectorGUI()

override void OnInspectorGUI ( NavGraph  target)
virtual

Override to implement graph inspectors.

Reimplemented from GraphEditor.

Reimplemented in LayerGridGraphEditor.

◆ OnSceneGUI()

override void OnSceneGUI ( NavGraph  target)
virtual

Override to implement scene GUI drawing for the graph.

Reimplemented from GraphEditor.

◆ PivotPointSelector()

static GridPivot PivotPointSelector ( GridPivot  pivot)
static

◆ RoundVector3()

static Vector3 RoundVector3 ( Vector3  v)
static

Rounds a vector's components to multiples of 0.5 (i.e 0.5, 1.0, 1.5, etc.) if very close to them.

◆ SaveReferenceTexture()

static void SaveReferenceTexture ( GridGraph  graph)
staticprivate

Member Data Documentation

◆ ChannelUseNames

readonly string [] ChannelUseNames = { "None", "Penalty", "Height", "Walkability and Penalty" }
staticprotected

◆ gridPivotSelectBackground

GUIStyle gridPivotSelectBackground
staticprivate

Cached gui style.

◆ gridPivotSelectButton

GUIStyle gridPivotSelectButton
staticprivate

Cached gui style.

◆ handlePoints

readonly Vector3 [] handlePoints = new [] { new Vector3(0.0f, 0, 0.5f), new Vector3(1.0f, 0, 0.5f), new Vector3(0.5f, 0, 0.0f), new Vector3(0.5f, 0, 1.0f) }
staticprivate

◆ isMouseDown

bool isMouseDown

◆ locked

bool locked = true

◆ lockStyle

GUIStyle lockStyle
staticprivate

Cached gui style.

◆ pivot

GridPivot pivot

◆ savedDimensions

Vector2 savedDimensions
private

◆ savedNodeSize

float savedNodeSize
private

◆ savedTransform

GraphTransform savedTransform
private

◆ showExtra

bool showExtra

◆ standardDimetric

readonly float standardDimetric = Mathf.Acos(1/2f)*Mathf.Rad2Deg
staticprivate

◆ standardIsometric

readonly float standardIsometric = 90-Mathf.Atan(1/Mathf.Sqrt(2))*Mathf.Rad2Deg
staticprivate

The documentation for this class was generated from the following file: