public override void ClearConnections (bool alsoReverse) {
if (alsoReverse) {
LayerGridGraph graph = GetGridGraph (GraphIndex);
int[] neighbourOffsets = graph.neighbourOffsets;
LevelGridNode[] nodes = graph.nodes;
for (int i=0;i<4;i++) {
int conn = GetConnectionValue(i);//(gridConnections >> i*4) & 0xF;
if (conn != LevelGridNode.NoConnection) {
LevelGridNode other = nodes[NodeInGridIndex+neighbourOffsets[i] + graph.width*graph.depth*conn];
if (other != null) {
//Remove reverse connection
/** \todo Check if correct */
other.SetConnectionValue(i < 4 ? ((i + 2) % 4) : (((5-2) % 4) + 4),NoConnection);
}
}
}
}
ResetAllGridConnections ();
}