Exemple #1
0
        protected override void HandleUpdate(PlayerInput input)
        {
            var t = StateCount / Mathf.Min(Owner.settings.MoveTime * _dist, Owner.settings.MaxMoveTime);

            t = Owner.settings.MoveCurve.Evaluate(t);
            Owner.transform.position = Vector3.Lerp(_startPoint, _transitionToPoint, t);
            var dist = (_transitionToPoint.ToVector3() - Owner.transform.position).magnitude;

            _tridentAnimation.SetHeight(dist + .65f);
            if (!(t >= 1))
            {
                return;
            }

            if (_moveCallback != null)
            {
                var shouldTransitionBack = _moveCallback(Owner);
                if (!shouldTransitionBack)
                {
                    return;
                }
            }

            Owner.transform.position = _transitionToPoint;
            Owner.TransitionTo(new IdlePlayerState(References));
        }
Exemple #2
0
 public override void EnterState()
 {
     References.Animator.SetBool("Moving", true);
     _tridentAnim.SetHeight(1);
     _tridentAnim.gameObject.SetActive(true);
 }