//after deserializing cells public void DeserializeConnections(bool deserializeJumpConnections) { foreach (var cell in serializedGraph.serializedCells) { Cell fromCell = cellPool[cell.id]; foreach (var connection in cell.serializedNormalConnections) { CellContentGenericConnection newCon = new CellContentGenericConnection( connection.data, fromCell, cellPool[connection.connectedCell], connection.interconnection, connection.costFrom, connection.costTo, connection.intersection); fromCell.SetContent(newCon); } if (deserializeJumpConnections) { foreach (var connection in cell.serializedJumpConnections) { CellContentPointedConnection newCon = new CellContentPointedConnection( connection.enterPoint, connection.lowerStandingPoint, connection.exitPoint, connection.axis, (ConnectionJumpState)connection.jumpState, fromCell, cellPool[connection.connectedCell], connection.interconnection); fromCell.SetContent(newCon); } } } }
public SerializedNormalConnection(NavmeshLayserSerializer ns, GraphSerializer gs, CellContentGenericConnection connection) { interconnection = connection.interconnection; fromCell = ns.GetCellID(connection.from); connectedCell = ns.GetCellID(connection.connection); data = connection.cellData; intersection = connection.intersection; costFrom = connection.costFrom; costTo = connection.costTo; }