public override void PostDeserialization()
{
base.UpdateTransform();
this.lastScannedWidth = this.width;
this.lastScannedDepth = this.depth;
this.SetUpOffsetsAndCosts();
LevelGridNode.SetGridGraph((int)this.graphIndex, this);
if (this.nodes == null || this.nodes.Length == 0)
{
return;
}
if (this.width * this.depth * this.layerCount != this.nodes.Length)
{
Debug.LogError("Node data did not match with bounds data. Probably a change to the bounds/width/depth data was made after scanning the graph just prior to saving it. Nodes will be discarded");
this.nodes = new LevelGridNode[0];
return;
}
for (int i = 0; i < this.layerCount; i++)
{
for (int j = 0; j < this.depth; j++)
{
for (int k = 0; k < this.width; k++)
{
LevelGridNode levelGridNode = this.nodes[j * this.width + k + this.width * this.depth * i];
if (levelGridNode != null)
{
levelGridNode.NodeInGridIndex = j * this.width + k;
levelGridNode.LayerCoordinateInGrid = i;
}
}
}
}
}