コード例 #1
0
        private PolyMeshDetail(SerializationInfo info, StreamingContext context)
        {
            // Note: Version compatability is handled by the interop call.
            if (info.MemberCount != 1)
            {
                return;
            }

            byte[] rawData = (byte[])info.GetValue(DataKey, typeof(byte[]));
            PolyMeshDetailEx.rcpdBuildFromMeshData(rawData, rawData.Length, this);
        }
コード例 #2
0
        /// <summary>
        /// Constructs a detail mesh from the data generated by the <see cref="GetSerializedData"/>
        /// method.
        /// </summary>
        /// <param name="serializedMesh">The source data.</param>
        /// <returns>The new detail mesh, or null on error.</returns>
        public static PolyMeshDetail Create(byte[] serializedMesh)
        {
            PolyMeshDetail result = new PolyMeshDetail(AllocType.External);

            if (PolyMeshDetailEx.rcpdBuildFromMeshData(serializedMesh
                                                       , serializedMesh.Length
                                                       , result))
            {
                return(result);
            }

            return(null);
        }