Exemple #1
0
    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);
    }
Exemple #2
0
 private void Start()
 {
     m_MeshRenderer  = GetComponent <MeshRenderer>();
     m_SkinAnimation = GetSkinAnimation();
     m_SkinAnimation.OnPoseBufferUpdate += OnAnimationUpdate;
 }