Example #1
0
        /// <summary>CallBack at the End of the Mount Animations </summary>
        public virtual void End_Mounting()
        {
            Montura.Mounted = Mounted = IsOnHorse = true;                              //Sync Mounted Values in Animal and Rider again Double Check

            if (Parent)
            {
                transform.localPosition = Vector3.zero;                                    //Reset Position when PARENTED
                transform.localRotation = Quaternion.identity;                             //Reset Rotation when PARENTED
            }

            MountInput?.Enable(true);

            Montura.EnableInput(true);                                              //Enable Animal Controls

            if (CreateColliderMounted)
            {
                MountingCollider(true);
            }

            if (Anim)
            {
                Anim.updateMode = Montura.Anim.updateMode;                       //Use the Same UpdateMode from the Animal
                                                                                 // Anim.updateMode = AnimatorUpdateMode.Normal;                       //Use the Same UpdateMode from the Animal
                Anim.SetBool(Montura.Animal.hash_Grounded, Montura.Animal.Grounded);
                Anim.SetInteger(Montura.Animal.hash_State, Montura.Animal.ActiveStateID);
                Anim.SetInteger(Montura.Animal.hash_Mode, Montura.Animal.ModeAbility);

                Montura.Animal.OnGrounded.AddListener(AnimalGrounded);
                Montura.Animal.OnStateChange.AddListener(AnimalState);
                Montura.Animal.OnModeStart.AddListener(AnimalMode);


                Montura.Animal.OnStanceChange.AddListener(AnimalStance);

                Anim.SetInteger(Montura.Animal.hash_Stance, Montura.ID);
            }
            OnEndMounting.Invoke();

            UpdateCanMountDismount();
        }
Example #2
0
 /// <summary>Enable the Input for the Mount</summary>
 public virtual void EnableInput(bool value)
 {
     MountInput?.Enable(value);
     Animal?.StopMoving();
 }