void Generate()
    {
        var image = (Texture2D)_gen.GetComponent<MeshRenderer>().sharedMaterial.mainTexture;
        var settings = ChangeTextureSettings(image, true, TextureImporterFormat.RGBA32);

        var quad = new nobnak.Subdivision.QuadtreeContour(image);
        var mesh = quad.Build(_gen.subdivisionLevel, _gen.alphaThreshold, _gen.optimization);
        _gen.GetComponent<MeshFilter>().mesh = mesh;

        RestoreTextureSettings(image, settings);
    }
Esempio n. 2
0
    void Generate()
    {
        var image    = (Texture2D)_gen.GetComponent <MeshRenderer>().sharedMaterial.mainTexture;
        var settings = ChangeTextureSettings(image, true, TextureImporterFormat.RGBA32);

        var quad = new nobnak.Subdivision.QuadtreeContour(image);
        var mesh = quad.Build(_gen.subdivisionLevel, _gen.alphaThreshold, _gen.optimization);

        _gen.GetComponent <MeshFilter>().mesh = mesh;

        RestoreTextureSettings(image, settings);
    }