Ejemplo n.º 1
0
 public void PlayAnimation(MDLAnimation animation, Action finishCallback = null)
 {
     m_animation         = animation;
     m_animationFinished = false;
     m_finishCallback    = finishCallback;
     SetFrameIndex(0);
 }
Ejemplo n.º 2
0
    public void RefreshModel()
    {
        if (m_model != null)
        {
            m_mesh      = m_model.mesh;
            m_animation = m_model.animation;

            var meshFilter = GetComponent <MeshFilter>();
            meshFilter.sharedMesh = m_model.mesh;

            var meshRenderer = GetComponent <MeshRenderer>();
            meshRenderer.sharedMaterial = m_model.material;
        }
        else
        {
            m_mesh      = null;
            m_animation = null;

            var meshFilter = GetComponent <MeshFilter>();
            meshFilter.sharedMesh = null;

            var meshRenderer = GetComponent <MeshRenderer>();
            meshRenderer.sharedMaterial = null;
        }
    }
Ejemplo n.º 3
0
 public void StopAnimation()
 {
     m_animation     = null;
     m_mesh.vertices = m_initialVertices;
 }