private SkinAnimation GetSkinAnimation() { Transform node = transform; int depth = 5; while (depth > 0) { Transform parent = node.parent; SkinAnimation animation = parent.GetComponent <SkinAnimation>(); if (animation != null) { return(animation); } node = node.parent; depth -= 1; } return(null); }
private void Start() { m_MeshRenderer = GetComponent <MeshRenderer>(); m_SkinAnimation = GetSkinAnimation(); m_SkinAnimation.OnPoseBufferUpdate += OnAnimationUpdate; }