public void PlayAnimation(MDLAnimation animation, Action finishCallback = null) { m_animation = animation; m_animationFinished = false; m_finishCallback = finishCallback; SetFrameIndex(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; } }
public void StopAnimation() { m_animation = null; m_mesh.vertices = m_initialVertices; }