Pathfinding.TriangleMeshNode.DeserializeNode C# (CSharp) Method

DeserializeNode() public method

public DeserializeNode ( GraphSerializationContext ctx ) : void
ctx Pathfinding.Serialization.GraphSerializationContext
return void
		public override void DeserializeNode (GraphSerializationContext ctx)
		{
			base.DeserializeNode (ctx);
			v0 = ctx.reader.ReadInt32();
			v1 = ctx.reader.ReadInt32();
			v2 = ctx.reader.ReadInt32();
		}
	}

Usage Example

Ejemplo n.º 1
0
        public override void DeserializeExtraInfo(GraphSerializationContext ctx)
        {
            uint graphIndex = (uint)ctx.graphIndex;

            TriangleMeshNode.SetNavmeshHolder((int)graphIndex, this);
            int num  = ctx.reader.ReadInt32();
            int num2 = ctx.reader.ReadInt32();

            if (num == -1)
            {
                this.nodes            = new TriangleMeshNode[0];
                this._vertices        = new Int3[0];
                this.originalVertices = new Vector3[0];
            }
            this.nodes            = new TriangleMeshNode[num];
            this._vertices        = new Int3[num2];
            this.originalVertices = new Vector3[num2];
            for (int i = 0; i < num2; i++)
            {
                this._vertices[i]        = new Int3(ctx.reader.ReadInt32(), ctx.reader.ReadInt32(), ctx.reader.ReadInt32());
                this.originalVertices[i] = new Vector3(ctx.reader.ReadSingle(), ctx.reader.ReadSingle(), ctx.reader.ReadSingle());
            }
            this.bbTree = new BBTree();
            for (int j = 0; j < num; j++)
            {
                this.nodes[j] = new TriangleMeshNode(this.active);
                TriangleMeshNode triangleMeshNode = this.nodes[j];
                triangleMeshNode.DeserializeNode(ctx);
                triangleMeshNode.UpdatePositionFromVertices();
            }
            this.bbTree.RebuildFrom(this.nodes);
        }
All Usage Examples Of Pathfinding.TriangleMeshNode::DeserializeNode