using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test2 : MonoBehaviour
{
    public static Test2 ins;

    // Start is called before the first frame update
    void Start()
    {
        ins = this;
    }

    public SkinnedMeshRenderer smr;
    public CanvasRenderer cr;
    public Animator am;

    // Update is called once per frame
    void Update()
    {
        am.Update(1);

        var baked = new Mesh();
        smr.BakeMesh(baked);

        cr.Clear();
        cr.materialCount = 1;
        cr.SetMaterial(smr.sharedMaterial, 0);
        cr.SetMesh(baked);
    }
}
