Pathfinding.GridGraph.UpdateSizeFromWidthDepth C# (CSharp) Method

UpdateSizeFromWidthDepth() public method

public UpdateSizeFromWidthDepth ( ) : void
return void
        public void UpdateSizeFromWidthDepth()
        {
            unclampedSize = new Vector2 (width,depth)*nodeSize;
            GenerateMatrix ();
        }

Usage Example

Ejemplo n.º 1
0
    private void initGraph(GridGraph g, Vector3 center, int width, int depth, int nodeSize)
    {
        g.center = center;
        g.width = width;
        g.depth = depth;
        g.nodeSize = nodeSize;
        g.maxSlope = 50;
        g.maxClimb = 0;

        g.autoLinkGrids = true;

        g.collision.collisionCheck = true;
        g.collision.diameter = 1.5f;
        g.collision.height = 3;
        g.collision.collisionOffset = 2;
        int obstacleLayer = LayerMask.NameToLayer("Obstacle");
        int obstacleMask = 1 << obstacleLayer;
        g.collision.mask = obstacleMask;
        g.collision.heightCheck = true;
        int groundLayer = LayerMask.NameToLayer("Ground");
        int groundMask = 1 << groundLayer;

        g.collision.heightMask = groundMask;

        g.UpdateSizeFromWidthDepth ();
        AstarPath.active.astarData.AddGraph(g);
    }
All Usage Examples Of Pathfinding.GridGraph::UpdateSizeFromWidthDepth