/** Deserializes common info. * Common info is what is shared between the editor serialization and the runtime serializer. * This is mostly everything except the graph inspectors which serialize some extra data in the editor */ public void DeserializeGraphsPart(Pathfinding.Serialize.AstarSerializer sr) { graphs = sr.DeserializeGraphs(); userConnections = sr.DeserializeUserConnections(); sr.DeserializeNodes(); sr.DeserializeExtraInfo(); sr.PostDeserialization(); }
/** Deserializes common info additively * Common info is what is shared between the editor serialization and the runtime serializer. * This is mostly everything except the graph inspectors which serialize some extra data in the editor */ public void DeserializeGraphsPartAdditive(Pathfinding.Serialize.AstarSerializer sr) { if (graphs == null) { graphs = new NavGraph[0]; } if (userConnections == null) { userConnections = new UserConnection[0]; } List <NavGraph> gr = new List <NavGraph>(graphs); gr.AddRange(sr.DeserializeGraphs()); graphs = gr.ToArray(); List <UserConnection> conns = new List <UserConnection>(userConnections); conns.AddRange(sr.DeserializeUserConnections()); userConnections = conns.ToArray(); sr.DeserializeNodes(); sr.DeserializeExtraInfo(); sr.PostDeserialization(); }