Beispiel #1
0
        public SerializedCell(NavmeshLayserSerializer ns, GraphSerializer gs, Cell cell)
        {
            id    = ns.GetCellID(cell);
            layer = cell.layer;

            isAdvancedAreaCell = cell.advancedAreaCell;
            if (cell.advancedAreaCell)
            {
                AreaAdvanced aa = cell.area as AreaAdvanced;
                area = ns.GetGameObjectID(aa.container.gameObject);
            }
            else
            {
                area = cell.area.id;
            }

            passability = (int)cell.passability;
            center      = cell.centerVector3;

            data          = new List <CellContentData>(cell.data);
            originalEdges = new List <CellContentData>(cell.originalEdges);

            foreach (var connection in cell.connections)
            {
                if (connection is CellContentGenericConnection)
                {
                    serializedNormalConnections.Add(new SerializedNormalConnection(ns, gs, connection as CellContentGenericConnection));
                }

                if (connection is CellContentPointedConnection)
                {
                    serializedJumpConnections.Add(new SerializedJumpConnection(ns, connection as CellContentPointedConnection));
                }
            }
        }