示例#1
0
 /** Serializes common info to the serializer.
  * 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 SerializeGraphsPart(Pathfinding.Serialization.AstarSerializer sr)
 {
     sr.SerializeGraphs(graphs);
     sr.SerializeUserConnections(userConnections);
     sr.SerializeNodes();
     sr.SerializeExtraInfo();
 }
示例#2
0
        /** Main serializer function.
         * Serializes all graphs to a byte array
         * A similar function exists in the AstarPathEditor.cs script to save additional info */
        public byte[] SerializeGraphs(Pathfinding.Serialization.SerializeSettings settings, out uint checksum)
        {
            var graphLock = AssertSafe();
            var sr        = new Pathfinding.Serialization.AstarSerializer(this, settings);

            sr.OpenSerialize();
            sr.SerializeGraphs(graphs);
            sr.SerializeExtraInfo();
            byte[] bytes = sr.CloseSerialize();
            checksum = sr.GetChecksum();
            graphLock.Release();
            return(bytes);
        }
示例#3
0
        /** Main serializer function.
         * Serializes all graphs to a byte array
         * A similar function exists in the AstarPathEditor.cs script to save additional info */
        public byte[] SerializeGraphs(Pathfinding.Serialization.SerializeSettings settings, out uint checksum)
        {
            var graphLock = AssertSafe();
            var sr        = new Pathfinding.Serialization.AstarSerializer(this, settings);

            sr.OpenSerialize();
            sr.SerializeGraphs(graphs);
            sr.SerializeExtraInfo();
            byte[] bytes = sr.CloseSerialize();
            checksum = sr.GetChecksum();
#if ASTARDEBUG
            Debug.Log("Got a whole bunch of data, " + bytes.Length + " bytes");
#endif
            graphLock.Release();
            return(bytes);
        }
示例#4
0
 /** Serializes common info to the serializer.
  * 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 SerializeGraphsPart(Pathfinding.Serialization.AstarSerializer sr)
 {
     sr.SerializeGraphs(graphs);
     sr.SerializeExtraInfo();
 }