Пример #1
0
        override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            animator.SetInteger(Hash.MountSide, 0);                //remove the side of the mounted ****IMPORTANT
            rider = animator.GetComponent <Rider3rdPerson>();

            transform = animator.transform;

            AnimalScaleFactor = rider.Montura.Animal.ScaleFactor;         //Get the scale Factor from the Montura

            ResetFloatParameters(animator);

            MountTrigger = rider.MountTrigger.transform;

            Fix = rider.MountTrigger.Adjustment;            //Store the Fix

            rider.Start_Mounting();
        }
Пример #2
0
        override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            animator.SetInteger(Hash.MountSide, 0);                //remove the side of the mounted ****IMPORTANT

            rider = animator.GetComponent <Rider3rdPerson>();

            transform = animator.transform;
            hip       = animator.GetBoneTransform(HumanBodyBones.Hips);

            AnimalScaleFactor = rider.Montura.Animal.ScaleFactor;         //Get the scale Factor from the Montura

            ResetFloatParameters(animator);

            float CenterDiference = animator.transform.position.y - animator.pivotPosition.y;                                     //Mount Animations have the pivot on the CoG (Center of Gravity)

            transform.position = new Vector3(transform.position.x, transform.position.y + CenterDiference, transform.position.z); //Change the Position of the Rider from Feet to CoG

            MountTrigger = rider.MountTrigger.transform;

            Fix = rider.MountTrigger.Adjustment;            //Store the Fix


            rider.Start_Mounting();
        }