/// <summary>
        /// The ability has started.
        /// </summary>
        protected override void AbilityStarted()
        {
            base.AbilityStarted();

            m_LeftMount = m_Rideable.Transform.InverseTransformPoint(m_Transform.position).x < 0;
            m_Rideable.Mount(this);

            // The character will look independently of the rotation.
            EventHandler.ExecuteEvent(m_GameObject, "OnCharacterForceIndependentLook", true);
            m_RideState = RideState.Mount;
            m_CharacterLocomotion.UpdateAbilityAnimatorParameters();
            // Update the rideable object's parameters as well so it can stay synchronized to the ride obejct.
            m_Rideable.CharacterLocomotion.UpdateAbilityAnimatorParameters();
            if (!m_MountEvent.WaitForAnimationEvent)
            {
                m_MountDismountEvent = Scheduler.Schedule(m_MountEvent.Duration, OnMount);
            }
        }
Beispiel #2
0
        /// <summary>
        /// The ability has started.
        /// </summary>
        protected override void AbilityStarted()
        {
            base.AbilityStarted();

            m_StartUpdateLocation = m_CharacterLocomotion.UpdateLocation;
            // Used FixedUpdate so the root motion location is accurate when getting on the Rideable object.
            m_CharacterLocomotion.UpdateLocation = KinematicObjectManager.UpdateLocation.FixedUpdate;

            m_LeftMount = m_Rideable.Transform.InverseTransformPoint(m_Transform.position).x < 0;
            m_Rideable.Mount(this);
            m_CharacterLocomotion.SetPlatform(m_Rideable.Transform);

            // The character will look independently of the rotation.
            EventHandler.ExecuteEvent(m_GameObject, "OnCharacterForceIndependentLook", true);
            m_RideState = RideState.Mount;
            m_CharacterLocomotion.UpdateAbilityAnimatorParameters();

            // Update the rideable object's parameters as well so it can stay synchronized to the ride obejct.
            m_Rideable.CharacterLocomotion.UpdateAbilityAnimatorParameters();
            if (!m_MountEvent.WaitForAnimationEvent)
            {
                m_MountDismountEvent = SchedulerBase.Schedule(m_MountEvent.Duration, OnMount);
            }
        }