Пример #1
0
        public void EndInteraction(bool immediately = false)
        {
            if (null != m_CasterInteractionSystem)
            {
                for (int i = 0; i < casterEffectors.Length; i++)
                {
                    if (immediately || !m_CasterInteractionSystem.IsPaused(casterEffectors[i]))
                    {
                        m_CasterInteractionSystem.StopInteraction(casterEffectors[i]);
                    }
                    else
                    {
                        m_CasterInteractionSystem.ResumeInteraction(casterEffectors[i]);
                    }
                }
            }

            if (null != m_TargetInteractionSystem)
            {
                for (int i = 0; i < targetEffectors.Length; i++)
                {
                    if (immediately)
                    {
                        m_TargetInteractionSystem.StopInteraction(targetEffectors[i]);
                    }
                    else
                    {
                        m_TargetInteractionSystem.ResumeInteraction(targetEffectors[i]);
                    }
                }
            }
        }
    /// <summary>
    /// 手上空的时候,停止抓取的动画
    /// </summary>
    void StopGrabAnimation()
    {
        animator.SetLayerWeight(1, 0);
        interactionSystem.StopInteraction(FullBodyBipedEffector.RightHand);
        interactionSystem.StopInteraction(FullBodyBipedEffector.LeftHand);


        var poser = animator.GetBoneTransform(HumanBodyBones.RightHand).GetComponent <Poser>();

        if (poser != null)
        {
            poser.poseRoot = null;
            poser.weight   = 0f;
        }
        poser = animator.GetBoneTransform(HumanBodyBones.LeftHand).GetComponent <Poser>();
        if (poser != null)
        {
            poser.poseRoot = null;
            poser.weight   = 0f;
        }
    }