Pathfinding.LevelGridNode.GetGridGraph C# (CSharp) Method

GetGridGraph() public static method

public static GetGridGraph ( uint graphIndex ) : LayerGridGraph
graphIndex uint
return LayerGridGraph
		public static LayerGridGraph GetGridGraph (uint graphIndex) { return _gridGraphs[(int)graphIndex]; }
		

Usage Example

        // Token: 0x06002509 RID: 9481 RVA: 0x0019CDFC File Offset: 0x0019AFFC
        public override bool GetPortal(GraphNode other, List <Vector3> left, List <Vector3> right, bool backwards)
        {
            if (backwards)
            {
                return(true);
            }
            LayerGridGraph gridGraph = LevelGridNode.GetGridGraph(base.GraphIndex);

            int[]           neighbourOffsets = gridGraph.neighbourOffsets;
            LevelGridNode[] nodes            = gridGraph.nodes;
            int             nodeInGridIndex  = base.NodeInGridIndex;

            for (int i = 0; i < 4; i++)
            {
                int connectionValue = this.GetConnectionValue(i);
                if (connectionValue != 255 && other == nodes[nodeInGridIndex + neighbourOffsets[i] + gridGraph.lastScannedWidth * gridGraph.lastScannedDepth * connectionValue])
                {
                    Vector3 a      = (Vector3)(this.position + other.position) * 0.5f;
                    Vector3 vector = Vector3.Cross(gridGraph.collision.up, (Vector3)(other.position - this.position));
                    vector.Normalize();
                    vector *= gridGraph.nodeSize * 0.5f;
                    left.Add(a - vector);
                    right.Add(a + vector);
                    return(true);
                }
            }
            return(false);
        }
All Usage Examples Of Pathfinding.LevelGridNode::GetGridGraph