Exemple #1
0
        public void Update()
        {
            // Get new mesh version and buffer sizes
            int blockBufferSize  = 0;
            int vertexBufferSize = 0;
            int faceBufferSize   = 0;

            unsafe
            {
                var newVersion = SDPlugin.SixDegreesSDK_GetBlockMeshInfo(&blockBufferSize, &vertexBufferSize, &faceBufferSize);

                if (newVersion > MeshVersion)
                {
                    if (blockBufferSize > 0 &&
                        vertexBufferSize > 0 &&
                        faceBufferSize > 0)
                    {
                    }
                    else
                    {
                        return;
                    }

                    if (MeshVersion < 0)
                    {
                        BlockSize = SDPlugin.SixDegreesSDK_GetMeshBlockSize();
                    }
                    UpdateMesh(newVersion: newVersion, blockBufferSize: blockBufferSize, vertexBufferSize: vertexBufferSize, faceBufferSize: faceBufferSize);
                }
                else if (newVersion == 0 &&
                         MeshVersion > 0)
                {
                    ClearMesh();
                }
            }
        }