Exemple #1
0
    public void OnBeforeSerialize()
    {
        if (!mesh)
        {
            return;
        }

        _uv  = mesh.uv;
        _uv2 = mesh.uv2;
        _uv3 = mesh.uv3;
        _uv4 = mesh.uv4;

        _vertices    = mesh.vertices;
        _triangles   = mesh.triangles;
        _normals     = mesh.normals;
        _tangents    = mesh.tangents;
        _bounds      = mesh.bounds;
        _bindposes   = mesh.bindposes;
        _boneweights = mesh.boneWeights;
        _colors32    = mesh.colors32;

        _subMeshes = new SubMeshCache[mesh.subMeshCount];
        for (var i = 0; i < mesh.subMeshCount; i++)
        {
            _subMeshes[i] = new SubMeshCache {
                indices = mesh.GetIndices(i), topology = mesh.GetTopology(i)
            };
        }
    }
Exemple #2
0
    public void OnBeforeSerialize()
    {
        if (!mesh) {
            return;
        }

        _uv = mesh.uv;
        _uv2 = mesh.uv2;
        _uv3 = mesh.uv3;
        _uv4 = mesh.uv4;

        _vertices = mesh.vertices;
        _triangles = mesh.triangles;
        _normals = mesh.normals;
        _tangents = mesh.tangents;
        _bounds = mesh.bounds;
        _bindposes = mesh.bindposes;
        _boneweights = mesh.boneWeights;
        _colors32 = mesh.colors32;

        _subMeshes = new SubMeshCache[mesh.subMeshCount];
        for (var i = 0; i < mesh.subMeshCount; i++) {
            _subMeshes[i] = new SubMeshCache {indices = mesh.GetIndices(i), topology = mesh.GetTopology(i)};
        }
    }