If I have this base class

```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GridBase : MonoBehaviour {
public NodeBase node;
public NodeBase[,] grid;
[HideInInspector]
public int gridSizeX, gridSizeY; // This this the number of the grid to generate nodes in
public bool displayGridGizmos; // Toggle GizmoDraw
public Vector2 gridWorldSize; // This the world size in WS, grid will fit itself in here depending on the nodeRadius
public float nodeRadius; // Node radius we use to generate our grid sizes
public float nodeDiameter; // Node diameter we use to generate our grid sizes
//
// Create Grid from any node inherated from NodeBase
public T[,] CreateGrid<T>(T node ) where T : NodeBase{
//
// Set Grid size based on node Diameter
nodeDiameter = nodeRadius*2;
gridSizeX = Mathf.RoundToInt(gridWorldSize.x/nodeDiameter);
gridSizeY = Mathf.RoundToInt(gridWorldSize.y/nodeDiameter);
//
// Create Grid with given size
grid = new T[gridSizeX, gridSizeY];
//
// Find worldBottomLeft
Vector3 worldBottomLeft = transform.position - Vector3.right * gridWorldSize.x / 2 - Vector3.forward * gridWorldSize.y / 2;
//
// Populate grid
for (int x = 0; x < gridSizeX; x++) {
for (int y = 0; y < gridSizeY; y++) {
Vector3 worldPoint = worldBottomLeft + Vector3.right * (x * nodeDiameter + nodeRadius) + Vector3.forward * (y * nodeDiameter + nodeRadius);
grid [x, y] = System.Activator.CreateInstance(typeof(T), worldPoint, x, y) as T; /*This comes at a performace cost */
}
}
//
// Return Grid
return grid;
}
//
// Return node in a given grid from a worldPosition
public T GetNodeFromWorldPoint<T>(T[,] gridIn, Vector3 worldPositionIn ) where T : INodeAttrGridable
{
//
// Convet the worldPosition into a percentage
float percentX = (worldPositionIn.x + gridWorldSize.x/2) / gridWorldSize.x;
float percentY = (worldPositionIn.z + gridWorldSize.y/2) / gridWorldSize.y;
percentX = Mathf.Clamp01(percentX);
percentY = Mathf.Clamp01(percentY);
//
// Convert percentage into index
int x = Mathf.RoundToInt((gridSizeX-1) * percentX);
int y = Mathf.RoundToInt((gridSizeY-1) * percentY);
return gridIn[x,y];
}
}
```

and I create my grid of nodes

```
grid = CreateGrid<NodeBase> (nodeBase);
```

I call GetNodeFromWorldPoint like so

```
NodeBase targetNode = grid.GetNodeFromWorldPoint( grid, vecWorldPos);
```

… Is there a way not to change the method so that I dont have to pass the grid into the method, like this

```
NodeBase targetNode = grid.GetNodeFromWorldPoint( vecWorldPos);
```

Thanks you