Ejemplo n.º 1
0
        protected override void DeserializeSettingsCompatibility(GraphSerializationContext ctx)
        {
            base.DeserializeSettingsCompatibility(ctx);

            characterRadius = ctx.reader.ReadSingle();
            contourMaxError = ctx.reader.ReadSingle();
            cellSize        = ctx.reader.ReadSingle();
            ctx.reader.ReadSingle();             // Backwards compatibility, cellHeight was previously read here
            walkableHeight           = ctx.reader.ReadSingle();
            maxSlope                 = ctx.reader.ReadSingle();
            maxEdgeLength            = ctx.reader.ReadSingle();
            editorTileSize           = ctx.reader.ReadInt32();
            tileSizeX                = ctx.reader.ReadInt32();
            nearestSearchOnlyXZ      = ctx.reader.ReadBoolean();
            useTiles                 = ctx.reader.ReadBoolean();
            relevantGraphSurfaceMode = (RelevantGraphSurfaceMode)ctx.reader.ReadInt32();
            rasterizeColliders       = ctx.reader.ReadBoolean();
            rasterizeMeshes          = ctx.reader.ReadBoolean();
            rasterizeTerrain         = ctx.reader.ReadBoolean();
            rasterizeTrees           = ctx.reader.ReadBoolean();
            colliderRasterizeDetail  = ctx.reader.ReadSingle();
            forcedBoundsCenter       = ctx.DeserializeVector3();
            forcedBoundsSize         = ctx.DeserializeVector3();
            mask = ctx.reader.ReadInt32();

            int count = ctx.reader.ReadInt32();

            tagMask = new List <string>(count);
            for (int i = 0; i < count; i++)
            {
                tagMask.Add(ctx.reader.ReadString());
            }

            showMeshOutline     = ctx.reader.ReadBoolean();
            showNodeConnections = ctx.reader.ReadBoolean();
            terrainSampleSize   = ctx.reader.ReadInt32();

            // These were originally forgotten but added in an upgrade
            // To keep backwards compatibility, they are only deserialized
            // If they exist in the streamed data
            walkableClimb = ctx.DeserializeFloat(walkableClimb);
            minRegionSize = ctx.DeserializeFloat(minRegionSize);

            // Make the world square if this value is not in the stream
            tileSizeZ = ctx.DeserializeInt(tileSizeX);

            showMeshSurface = ctx.reader.ReadBoolean();
        }
Ejemplo n.º 2
0
        public override void DeserializeSettingsCompatibility(GraphSerializationContext ctx)
        {
            base.DeserializeSettingsCompatibility(ctx);
            this.characterRadius = ctx.reader.ReadSingle();
            this.contourMaxError = ctx.reader.ReadSingle();
            this.cellSize        = ctx.reader.ReadSingle();
            ctx.reader.ReadSingle();
            this.walkableHeight           = ctx.reader.ReadSingle();
            this.maxSlope                 = ctx.reader.ReadSingle();
            this.maxEdgeLength            = ctx.reader.ReadSingle();
            this.editorTileSize           = ctx.reader.ReadInt32();
            this.tileSizeX                = ctx.reader.ReadInt32();
            this.nearestSearchOnlyXZ      = ctx.reader.ReadBoolean();
            this.useTiles                 = ctx.reader.ReadBoolean();
            this.relevantGraphSurfaceMode = (RecastGraph.RelevantGraphSurfaceMode)ctx.reader.ReadInt32();
            this.rasterizeColliders       = ctx.reader.ReadBoolean();
            this.rasterizeMeshes          = ctx.reader.ReadBoolean();
            this.rasterizeTerrain         = ctx.reader.ReadBoolean();
            this.rasterizeTrees           = ctx.reader.ReadBoolean();
            this.colliderRasterizeDetail  = ctx.reader.ReadSingle();
            this.forcedBoundsCenter       = ctx.DeserializeVector3();
            this.forcedBoundsSize         = ctx.DeserializeVector3();
            this.mask = ctx.reader.ReadInt32();
            int num = ctx.reader.ReadInt32();

            this.tagMask = new List <string>(num);
            for (int i = 0; i < num; i++)
            {
                this.tagMask.Add(ctx.reader.ReadString());
            }
            this.showMeshOutline     = ctx.reader.ReadBoolean();
            this.showNodeConnections = ctx.reader.ReadBoolean();
            this.terrainSampleSize   = ctx.reader.ReadInt32();
            this.walkableClimb       = ctx.DeserializeFloat(this.walkableClimb);
            this.minRegionSize       = ctx.DeserializeFloat(this.minRegionSize);
            this.tileSizeZ           = ctx.DeserializeInt(this.tileSizeX);
            this.showMeshSurface     = ctx.reader.ReadBoolean();
        }