Exemplo n.º 1
0
        IEnumerator AlreadyMountedC()
        {
            yield return(null);      //Wait for the next frame

            if (AnimalStored != null && StartMounted)
            {
                Montura             = AnimalStored;
                Montura.ActiveRider = this;

                if (MountTrigger == null)
                {
                    Montura.transform.GetComponentInChildren <MountTriggers>();                      //Save the first Mount trigger you found
                }
                Start_Mounting();
                End_Mounting();

                if (Anim)
                {
                    Anim.Play(Montura.MountIdle, MountLayerIndex);                     //Play Mount Idle Animation Directly
                }
                toogleCall = true;                                                     //Turn Off the Call

                Montura.Mounted = Mounted = true;                                      //Send to the animalMount that mounted is active

                Anim.SetBool(Hash.Mount, mounted);                                     //Update Mount Parameter In the Animator
            }

            Montura.Animal.OnSyncAnimator.AddListener(SyncAnimator);                   //Add the Sync Method to sync all parameters
            OnAlreadyMounted.Invoke();
        }
Exemplo n.º 2
0
        // protected Vector3 DeltaMountPointPos;



        ///──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        /// <summary>
        /// CallBack at the Start of the Mount Animations
        /// </summary>
        public virtual void Start_Mounting()
        {
            Montura.ActiveRider = this;
            Montura.Mounted     = Mounted = true;           //Sync Mounted Values in Animal and Rider

            if (_rigidbody)                                 //Deactivate stuffs for the Rider's Rigid Body
            {
                _rigidbody.useGravity = false;
                //  _rigidbody.isKinematic = true;
                DefaultConstraints     = _rigidbody.constraints;
                _rigidbody.constraints = RigidbodyConstraints.FreezeAll;
                // _rigidbody.constraints = RigidbodyConstraints.None;
            }

            ToogleColliders(false);                         //Deactivate All Colliders

            toogleCall = true;                              //Set the Call to Stop Animal
            CallAnimal(false);                              //If is there an animal following us stop him

            if (Montura.Animal)
            {
                AnimalStored = Montura.Animal.GetComponent <Mountable>(); //Store the last animal you mounted
            }

            if (Parent)
            {
                transform.parent = Montura.MountPoint;
            }
        }
Exemplo n.º 3
0
        void Start()
        {
            Montura = GetComponent <Mountable>();

            if (ReinLeftHand && ReinRightHand)
            {
                LocalStride_L = ReinLeftHand.localPosition;
                LocalStride_R = ReinRightHand.localPosition;
            }
            else
            {
                Debug.LogWarning("Some of the Reins has not been set on the inspector. Please fill the values");
            }
        }
Exemplo n.º 4
0
        ///──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        /// <summary>
        /// CallBack at the Start of the Mount Animations
        /// </summary>
        public virtual void Start_Mounting()
        {
            Montura.Mounted = Mounted = true;               //Sync Mounted Values in Animal and Rider

            if (_rigidbody)                                 //Deactivate stuffs for the Rider's Rigid Body
            {
                _rigidbody.useGravity  = false;
                _rigidbody.isKinematic = true;
            }

            ToogleColliders(false);                         //Deactivate All Colliders

            toogleCall = true;                              //Set the Call to Stop Animal
            CallAnimal(false);                              //If is there an animal following us stop him

            if (Montura.Animal)
            {
                AnimalStored = Montura.Animal.GetComponent <Mountable>(); //Store the last animal you mounted
            }
        }
Exemplo n.º 5
0
 ///──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 /// <summary>
 /// To change the animal Stored
 /// </summary>
 public virtual void SetAnimalStored(Mountable MAnimal)
 {
     AnimalStored = MAnimal;
 }
Exemplo n.º 6
0
 private void OnEnable()
 {
     M      = (Mountable)target;
     script = MonoScript.FromMonoBehaviour(M);
 }
Exemplo n.º 7
0
 private void Awake()
 {
     Montura = GetComponent <Mountable>();
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Awake()
 {
     Montura = GetComponentInParent <Mountable>(); //Get the Mountable in the parents
 }