Pathfinding.LevelGridNode.GetConnectionValue C# (CSharp) Method

GetConnectionValue() public method

public GetConnectionValue ( int dir ) : int
dir int
return int
		public int GetConnectionValue (int dir) {
			return (int)((gridConnections >> dir*ConnectionStride) & ConnectionMask);
		}
		

Usage Example

Ejemplo n.º 1
0
        public override void OnDrawGizmos(bool drawNodes)
        {
            if (!drawNodes)
            {
                return;
            }
            base.OnDrawGizmos(false);
            if (this.nodes == null)
            {
                return;
            }
            PathHandler debugPathData = AstarPath.active.debugPathData;

            for (int i = 0; i < this.nodes.Length; i++)
            {
                LevelGridNode levelGridNode = this.nodes[i];
                if (levelGridNode != null && levelGridNode.Walkable)
                {
                    Gizmos.color = this.NodeColor(levelGridNode, AstarPath.active.debugPathData);
                    if (AstarPath.active.showSearchTree && AstarPath.active.debugPathData != null)
                    {
                        if (NavGraph.InSearchTree(levelGridNode, AstarPath.active.debugPath))
                        {
                            PathNode pathNode = debugPathData.GetPathNode(levelGridNode);
                            if (pathNode != null && pathNode.parent != null)
                            {
                                Gizmos.DrawLine((Vector3)levelGridNode.position, (Vector3)pathNode.parent.node.position);
                            }
                        }
                    }
                    else
                    {
                        for (int j = 0; j < 4; j++)
                        {
                            int connectionValue = levelGridNode.GetConnectionValue(j);
                            if (connectionValue != 255)
                            {
                                int num = levelGridNode.NodeInGridIndex + this.neighbourOffsets[j] + this.width * this.depth * connectionValue;
                                if (num >= 0 && num < this.nodes.Length)
                                {
                                    GraphNode graphNode = this.nodes[num];
                                    if (graphNode != null)
                                    {
                                        Gizmos.DrawLine((Vector3)levelGridNode.position, (Vector3)graphNode.position);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
All Usage Examples Of Pathfinding.LevelGridNode::GetConnectionValue