cell based path finding

So, I’m trying to make a very simple path finding system for AI with cells instead of nodes. I’m trying to some up with a cell and door system. So, basically it’s cubes that fill up a room set up in a way that each cube has one or more overlapping door cubes. The cubes will have to be set up in a way that from anywhere in the cube, the AI will be able to walk straight at any overlapping door with out collisions. To determine which door to walk towards, each door will have an array with a list of all cell cubes and how many doors you’ll have to go through to get to that cell and then choose the door with the lowest number of doors to go through to get to your goal cell.
here’s a picture to help illustrate what I’m talking about:

So I just need a way of having each door, at the start of the game, compile an array that saves how many doors you’ll have to go through to get to each cell. From there is should be as simple as choosing the door with the smallest number.
Any ideas or any links to node system formulas would be greatly appreciated, thanks.

I DID IT!!! tutorial coming soon!

door

var cells = new Array();
var doorsToCells = new Array();
var imediateCells = new Array();
var testForCells : boolean = true;
var waitToTestCells : float = 2;
var stage : int = 1;

function Awake ()
{
	cells = GameObject.FindGameObjectsWithTag("AIpathCell");
	doorsToCells.length = cells.length;
	testForCells = true;
	waitToTestCells = 2;
	stage = 1;
}

function LateUpdate ()
{
	if (testForCells  waitToTestCells <= 0)
	{
		for (var imediateCell : GameObject in imediateCells)
		{
			for (var i : int = 0; i <= cells.length - 1; i++)
			{
				if (cells[i] == imediateCell)
					doorsToCells[i] = 1;
			}
			
			for (stage = 2; stage <= GameObject.FindGameObjectsWithTag("AIpathCell").length; stage++)
			{
				for (i = 0; i <= cells.length - 1; i++)
				{
					if (doorsToCells[i] == stage - 1)
						for (var checkDoor : GameObject in cells[i].GetComponent(AIpathCell).doors)
						{
							if (checkDoor != gameObject)
							{
								for (var checkCell : GameObject in checkDoor.GetComponent(AIpathDoor).imediateCells)
								{
									for (var j : int = 0; j <= cells.length - 1; j++)
									{
										if (cells[j] == checkCell  doorsToCells[j] == null)
											doorsToCells[j] = stage;
									}
								}
							}
						}
				}
			}
			
		}
		testForCells = false;
	}
	waitToTestCells -= 1;
}

function OnTriggerEnter (other : Collider) 
{
	if (other.tag == "AIpathCell")
		imediateCells.Add(other.gameObject);
}

cell

var doors = new Array();

function OnTriggerEnter (other : Collider) 
{
	if (other.tag == "AIpathDoor")
		doors.Push(other.gameObject);
}

enemy AI

var currentCell : GameObject;
var playerCell : GameObject;
var goalDoor : GameObject;
var shortestPathSoFar : float;
var waitToStart : float = 5;

function Awake ()
{
	shortestPathSoFar = Mathf.Infinity;
}

function Update () 
{
if (waitToStart <= 0)
{
	for (var doorCheckingNow : GameObject in currentCell.GetComponent(AIpathCell).doors)
	{
		for (var i : int = 0; i <= doorCheckingNow.GetComponent(AIpathDoor).cells.length - 1; i++)
		{
			if (doorCheckingNow.GetComponent(AIpathDoor).cells[i] == playerCell)
				if (doorCheckingNow.GetComponent(AIpathDoor).doorsToCells[i] < shortestPathSoFar)
				{
					goalDoor = doorCheckingNow;
					shortestPathSoFar = doorCheckingNow.GetComponent(AIpathDoor).doorsToCells[i];
				}
					
		}
	}
	shortestPathSoFar = Mathf.Infinity;
}
waitToStart -= 1;
}

hey, thanks for the help eteeski
hey, you’re welcome eteeski

hey, dis s nice tutorials man.Thank u.