示例#1
0
        public byte[] SerializeGraphsExtra(SerializeSettings settings)
        {
            AstarPath.active.BlockUntilPathQueueBlocked();
            AstarSerializer astarSerializer = new AstarSerializer(this, settings);

            astarSerializer.OpenSerialize();
            astarSerializer.graphs = this.graphs;
            byte[] result = astarSerializer.SerializeExtraInfoBytes();
            astarSerializer.CloseSerialize();
            return(result);
        }
示例#2
0
        public byte[] SerializeGraphs(SerializeSettings settings, out uint checksum)
        {
            AstarPath.active.BlockUntilPathQueueBlocked();
            AstarSerializer astarSerializer = new AstarSerializer(this, settings);

            astarSerializer.OpenSerialize();
            this.SerializeGraphsPart(astarSerializer);
            byte[] result = astarSerializer.CloseSerialize();
            checksum = astarSerializer.GetChecksum();
            return(result);
        }
示例#3
0
        public byte[] SerializeGraphs(SerializeSettings settings, out uint checksum)
        {
            PathProcessor.GraphUpdateLock graphUpdateLock = this.AssertSafe(false);
            AstarSerializer astarSerializer = new AstarSerializer(this, settings);

            astarSerializer.OpenSerialize();
            this.SerializeGraphsPart(astarSerializer);
            byte[] result = astarSerializer.CloseSerialize();
            checksum = astarSerializer.GetChecksum();
            graphUpdateLock.Release();
            return(result);
        }
示例#4
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(SerializeSettings settings, out uint checksum)
        {
            AstarPath.active.BlockUntilPathQueueBlocked();

            var sr = new AstarSerializer(this, settings);

            sr.OpenSerialize();
            SerializeGraphsPart(sr);
            var bytes = sr.CloseSerialize();

            checksum = sr.GetChecksum();
            return(bytes);
        }
示例#5
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(SerializeSettings settings, out uint checksum)
        {
            var graphLock = AssertSafe();
            var sr        = new AstarSerializer(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);
        }